首页 \ 问答 \ 在Android Studio中使用@Contract(Using @Contract with Android Studio)

在Android Studio中使用@Contract(Using @Contract with Android Studio)

我试图使用IntelliJ的@Contract注释,但在Android Studio中。 我无法导入它,它不在那里。 在解释它网站上 ,据说使用“项目结构”对话框将<installation folder>/lib/annotations.jar添加到项目的类路径中,但是我没有找到如何解决这个问题。

无论如何在Android Studio上使用@Contract注释?


I'm trying to use the @Contract annotation of IntelliJ but in Android Studio. I can't import it, it's not there. On the website explaining it, it's said to add <installation folder>/lib/annotations.jar to the project's classpath using the Project Structure dialog, however I didn't found how to that.

Is there anyway to use the @Contract annotation on Android Studio?


原文:https://stackoverflow.com/questions/48592795
更新时间:2023-03-26 11:03

最满意答案

也许您必须从​​URL中删除端口号并配置CURLOPT_PORT选项。

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://pc.stephen3.com/gameq.php"); // port removed
curl_setopt($ch, CURLOPT_PORT, 8080);  // that line added
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$err = curl_error($ch);
$resp = curl_exec($ch);
echo $resp;
echo $err;

您还可以使用curl_getinfo($ch)函数获取更多调试信息。

$report=curl_getinfo($ch);
echo "curl_getinfo returned: <br>".$report;

It turns out my host (iPower) restricts cURL to port 80 :(

EDIT : I found out that support lied, saying only port 80 is allowed. In fact, they allow port 80 AND 990 (SSL) but you can use port 990 without actually having SSL on. Works perfectly.

相关问答

更多
  • 这不是因为代码。 这是因为加载代码的URL。 这个给了我“网络钓鱼警告”: http://127.0.0.1/proxy/?url=http://facebook.com 但是,使用https的更受信任的站点不会从AntiVirus发出任何警告。 https://127.0.0.1/proxy/?url=http://facebook.com It's not because of the code. It's because of the URL that is loading the code. T ...
  • 是的,有很多代理软件包可以运行(你甚至可以配置Apache来完成)。 如果这就是你的想法,建议不要在PHP中推出自己的产品。 您可以轻松配置curl以使用代理,请参阅curl_setopt的可能性。 Yes, there are lot's of proxy packages running out of the box (you could even configure apache to do it). Wouldn't recommend rolling your own in PHP if that ...
  • 也许您必须从URL中删除端口号并配置CURLOPT_PORT选项。 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://pc.stephen3.com/gameq.php"); // port removed curl_setopt($ch, CURLOPT_PORT, 8080); // that line added curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($ch, ...
  • 我假设您删除了密码,因为-u是HTTP身份验证。 以下示例具有您需要放置密码的密码 。 (虽然删除星星!)。 python -m json.tool是curl命令管道输入的内容,它是一个json格式化程序。 所以我假设你的服务正在返回一个json格式。 我不确定你的文件script@query.js是什么,所以我认为它是一个文件名。 因此添加了file_get_contents。 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://mixpan ...
  • 根据定义,代理人是中间人。 软件在客户端和服务器之间运行和工作。 客户端询问代理,然后它会转向服务器。 然后,“链接”代理将暗示第一个代理会询问第二个代理,但是当客户端要求代理执行其请求时,它不能是客户端要求第二个代理的工作,但它必须是第一个代理的任务。 唉:当然,如果你有一个代理A,你设置为与另一个代理B交谈,并告诉curl使用代理A,那么肯定会使用链式代理。 我甚至没有看到curl可以做什么不能用它... A proxy is by definition a middle man. Software r ...
  • 最后我发现,如果我使用纯IP而不是域名,它就可以工作。 我不喜欢网络的东西,但似乎有一个DNS问题。 但通过在URL中使用IP,一切正常。 Finally I found out, that it works if I use the pure IP instead of the domain name. I'm not familar with network stuff, but it seems that there was a problem with DNS. But by using the I ...
  • 所以问题不在于php或curl,但是在测试网址中,我完全有隧道视觉到这个并且它从未发生过,因为我正在测试它们对谷歌,所以它似乎是在17个线程的谷歌硬帽请求,在此之后,它抛弃否认 So the problem is not in php or curl, but in the test url, I totally had tunnel vision into this and it never occurred to me since I was testing them against google, a ...
  • 无论您是否使用代理服务器,以纯文本方式发送用户名和密码都不安全。 是的,代理可以读取它,您和您发送给它的网站之间也可以有其他人阅读。 Sending your username and password in plain text is never safe, regardless of whether you use a proxy or not. Yes, the proxy can read it, and so can anyone else between you and the site you ...
  • 这是在curl中使用代理的一个很好的答案 如何通过代理使用CURL? 请检查一下。 如果您有任何疑问,请随时提出。 谢谢 Here is a good answer to use proxy in curl How to use CURL via a proxy? Please check this. If you have any queries feel free to ask. Thanks
  • 尝试代理工作。 检查这里(codepad.viper-7.com/xzm8Au)您的服务器运行正常 当您使用匿名代理时,服务器无法查看或阻止您的真实IP Try working proxies. Check here (codepad.viper-7.com/xzm8Au) your server is running just fine. When you use anonymous proxy, then the remote(destination) server can't see or block ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)