问题标签 [android-async-http]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 使用 LoopJ AndroidAsyncHttp 多张上传照片
我将使用 LoopJ AndroidAsyncHttp 将多张照片/视频上传到服务器。我的问题是我需要为每张照片添加取消按钮并允许用户取消上传。我可以知道有人对此有解决方案吗?或任何其他更好的例子供我参考?我的代码如下:-
android - AsyncHttpClient ConnectException,没有错误消息
我有一个问题,但找不到任何解决方案,我在https://github.com/AsyncHttpClient/async-http-client中使用 AsyncHttpClient ,我可以在 API 级别 10 中运行我的代码,但不能在 API 级别 17 中运行。我收到此错误:
我在一家公司做一个项目,所以我不得不在上面的错误代码中隐藏 url,但是 url 正在工作,它们不是问题。任何帮助表示赞赏,谢谢。
android - Android AsyncHttpClient - “Content-Type not allowed!” Regardless of types provided
Good Day all.
My first time posting on SO, never had to before. Reading was always enough. Now, I'm just woefully stuck using AsyncHttpClient library for Android. It works fabulously in every other response besides downloading files, at least for me over the last day and a half of being stuck. :-)
Code:
The url used is correctly formed (I checked) and every other call using this library (JSON, Login POSTs) all work fine.
I've researched and tried everything that I can think of or have read through google searches or SO hits on this particular library in conjunction with this error and I have tried just about every imaginable MimeType to include to the call, still with the same error. I really would like to get this to work so I don't have to refactor all my code to use built in httpclients which is my next step I think. I also like this library very much.
Trying to download a simple png file.
The backend API call that serves up the image is working and has been for a year with different clients (browser, Titanium App, etc).
Connection is over SSL
All other calls (not involving downloading of files) to our backend work correctly with this library.
Any help would be appreciated. Thanks!
android - android-async-http loopj 设置下载文件的保存路径
请告诉我如何设置下载文件的保存路径。
例如:
android - Android async-http-client:向回调添加参数?
我想使用async-http-client将数据发布到服务器并保持设备上的 SQLite 与这些数据同步。所以基本上我希望整个事情:
- 将新数据惰性化到 SQLite
- 使用 async-http-client 将新数据发布到服务器
- 使用附加数据更新 onSuccess/onFailure 回调中的 SQLite 行
我的问题是:如何在 AsyncHttpResponseHandler 中获得正确的行 ID?
让我们创建一个简单的示例(没有数据库连接以保持简单但同样的问题)。
那么实现这一目标的最佳方法是什么?重写 AsyncHttpResponseHandler 以某种方式向回调函数添加参数?
java - Android文件上传使用loopj HttpClient
我正在将文件(图像、视频和音频)从 Android 端上传到 PHP 服务器。它适用于小文件。但是对于大文件,它会给出意想不到的结果,比如文件上传,但在 android 端它会给出超时异常。所以请帮助我,我如何处理文件上传的所有场景。我如何使用 HttpMultipart 实体以及如何针对不同大小的文件设置相对超时。我的代码是:
java - 如何使用来自互联网的数据初始化类并同步类实例变量
如果这有一个微不足道的答案,我想道歉,但我似乎无法为这种情况提出模式/流程。
我正在使用Android 异步 Http 客户端,它在完成请求时提供回调。我想这是我感到困惑的地方,因为我不知道在哪里使用该库。
这是我的设置:
数据类.java
ShowDataActivity.java
当我在 RestClient 回调中的实例变量赋值上放置断点时,我可以看到它们不是空的,而是其中包含正确的数据。
我已经搜索了一段时间,看到一些内置的 Android 库,如Loaders、ContentObserver和BoradcastReceivers可能会有所帮助,但我不知道如何将它们与Android Asynchronous Http Client结合使用。
请注意,上面的示例不完整,但所有相关信息都在那里。
如果需要更多信息,请告诉我。谢谢你。
问题:
当我在 ShowDataActivity 中实例化 DataClass 时,我的 dataClass 实例变量为空。我猜这是因为在我实例化对象之后的回调中分配了变量。不太确定如何问这个问题,但我怎样才能确保DataClass dataClass = new DataClass(id);
使用来自互联网的数据进行初始化。
php - 将多个图像上传到服务器会导致错误
我正在使用适用于 Android 的 Loopj AsyncHttpClient,它就像一个魅力。现在我正在尝试将三个小图像上传到我的服务器,但我遇到了一些问题。这很奇怪,因为如果我上传 2 张图片,它可以完美运行,但是当我尝试向同一个请求添加第三张图片时,服务器响应是文件上传的错误 3:
所以当我这样做时:
它有效......但是当我添加第三个时:
服务器无法处理请求...我检查了文件,服务器端应用程序似乎工作正常(我尝试使用邮递员发送数据并且它工作正常)
你知道为什么 AsyncHttpClient 上传 3 个文件失败但上传 2 个文件成功吗?
提前谢谢
android - Loopj AndroidAsyncHttp setTimeout
我正在使用 loopj 1.4.4 库在我的 android 设备上使用 4.2.2 发出 HTTP 请求。setTimeout 方法未按预期工作:
使用上面的代码,我在大约 40 秒后收到超时(特别是 onFailure 回调)......我哪里错了?我认为我的代码与这个没有太大区别:Loopj's AsyncHttpclient not setting the correct timeout
java - Loopj AsyncHttpResponseHandler 存储 onSuccess 响应
我尝试将 AsyncHttpResponseHandler 的响应字符串存储在这样的类变量中:
...但isLatestVersion 保持真实。覆盖此变量的正确/最聪明的方法是什么?