Questions tagged [android-async-http]

A Callback-Based Http Client Library for Android.

Overview

An asynchronous callback-based Http client for Android built on top of Apache’s HttpClient libraries. All requests are made outside of your app’s main UI thread, but any callback logic will be executed on the same thread as the callback was created using Android’s Handler message passing. You can also use it in Service or background thread, library will automatically recognize in which context is ran.

Features

  • Using upstream HttpClient of version 4.3.6 instead of Android provided DefaultHttpClient
  • Compatible with Android API 23 and higher
  • Make asynchronous HTTP requests, handle responses in anonymous callbacks
  • HTTP requests happen outside the UI thread
  • Requests use a threadpool to cap concurrent resource usage
  • GET/POST params builder (RequestParams)
  • Multipart file uploads with no additional third party libraries
  • Streamed JSON uploads with no additional libraries
  • Handling circular and relative redirects
  • Tiny size overhead to your application, only 90kb for everything
  • Automatic smart request retries optimized for spotty mobile connections
  • Automatic gzip response decoding support for super-fast requests
  • Binary protocol communication with BinaryHttpResponseHandler
  • Built-in response parsing into JSON with JsonHttpResponseHandler
  • Saving response directly into file with FileAsyncHttpResponseHandler
  • Persistent cookie store, saves cookies into your app’s SharedPreferences
  • Integration with Jackson JSON, Gson or other JSON (de)serializing libraries with BaseJsonHttpResponseHandler
  • Support for SAX parser with SaxAsyncHttpResponseHandler
  • Support for languages and content encodings, not just UTF-8

Library Link & More Information About Setup

Repo

loopj - James Smith

260 questions
0
votes
2 answers

GZipped content in http response of GET request using async-http-library for Android

I'm trying to access Google's geocode API using Android-Async-http library in my app. Here is my request and below is response: ���������������UMo�0��WX>Ӫ i{���UJ�$�J� mߔ%�===�������B��R��}���#�4�.�d�{��$�b��D��V<��<�����w*y�q���y5����o� …
Santhosh
  • 4,956
  • 12
  • 62
  • 90
0
votes
1 answer

Android Studio AsyncHttpClient Post Request not working REST

I am creating an app in Android Studio. I am trying to send 5 parameters to a database through a rest service I have previously configured. I have tested the webpage through a browser plugin and a post request and is working fine, so I know for sure…
0
votes
1 answer

Android: Mutliple threads from Async Task causing problems

I am downloading two different images from Parse SDK. The two images are downloading properly (I have confirmed it by downloading one type of image only) After downloading the images, same images are set into the lruCache. I think there is some…
ojas
  • 247
  • 1
  • 4
  • 17
0
votes
2 answers

Webview in backgroud: is it a bad practice ? Is HttpClient the solution?

I have an Activity that runs a WebView and inject some JS into a site (which i don't have control) and returns me some data. I need to do the same thing on background, with a service. How can i do this ? NOTE: I'm already using an IntentService,…
0
votes
0 answers

Android : AsyncHttpClient is going to onFailure

Am trying to parsing a url "http://api.androidhive.info/contacts/" using AsyncHttpClient , after onStart() it is going to onFailure(), its not going to onSuccess() method and giving the result. I try the same url by using normal AsyncTask , there…
Binil Surendran
  • 2,524
  • 6
  • 35
  • 58
0
votes
1 answer

How to download all images one by one and show progress status

I want to download all the images I have on server in the array string of Url one by one so that I may do not have to download a zip file of images from the server and to unzip after downloading it. So I thought to download the images one by one…
0
votes
2 answers

How to download the series of Images from Server

I have my own Server and I want to download the images one by one automatically. Right now what I have tried is downloading and saving the image on the device and that is working 100 percent perfectly. But that is working for single image here is…
Coas Mckey
  • 701
  • 1
  • 13
  • 39
0
votes
1 answer

Returning to calling function when a http request has finished

I'm trying to do implement login using a ASP.Net Web Api into an Android application. What I have so far are functions that work, just that I want to make the login request kind of synchronous instead of asynchronous. I'm using Android Asynchronous…
Alin I
  • 580
  • 1
  • 7
  • 24
0
votes
1 answer

android : Error:Execution failed for task ':app:dexDebug'

Getting the following error while running the project: Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command…
Chintan Soni
  • 24,761
  • 25
  • 106
  • 174
0
votes
0 answers

Get Value Listview Item from asyntask

How to get value when i clicked an item on custom listview which have data from asynctask, i clicked on item , how can i get a value of that paticular item id which come from in json format. @Override protected void onPostExecute(String result)…
0
votes
2 answers

LoopJ AndroidAsyncHttp StringEntity Issue

I am using StringEntity with AndroidAsyncHttp but it is deprecated. Is there another way to get this to work while sending my json string in the way I am to my web service? public void getPropertyImagesAsync(final String[] params) { …
Joe Ginley
  • 301
  • 3
  • 15
0
votes
1 answer

a url's response may be replaced by another url

I have two different domain urls named A.com and B.com. This is the code to send request: the asyncHttpClient is the same one. asyncHttpClient.post(context, "A.com", aParams, aResponseHandler); asyncHttpClient.post(context, "B.com", bParams,…
gustavo
  • 141
  • 1
  • 10
0
votes
0 answers

How to achieve breakpoint upload in android-async-http?

My server support breakpoint upload. How to achieve breakpoint upload in android-async-http? breakpoint upload mean "breakpoint resume" upload
ruijun
  • 35
  • 5
0
votes
1 answer

Continue using LoopJ AndroidAsyncHttp library (deprecation)

I need to communicate with our REST-API. I found the LoopJ AndroidAsyncHttp library, but I am not sure if it is a good idea to use it, because it seems to use the HttpClient which is now deprecated in Android API 22. I found this apache project, but…
KCD
  • 678
  • 5
  • 20
0
votes
1 answer

401 http error only in real android device, 200 success code in genymotion

My problem is, when i am logging in to my webservice, i am getting 401 error code. But i am getting this error code only in real android devices(i have tried this in 2 different phones and networks). But in genymotion i am not getting any error,…