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
1 answer

AsyncHttpClient ConnectException with no error message

I have a problem but could not be found any solution, I use AsyncHttpClient in https://github.com/AsyncHttpClient/async-http-client, I can run my code in API level 10, but not in API level 17. I am getting this error: 11-13 14:36:47.987 …
0
votes
1 answer

Multiple upload photo using LoopJ AndroidAsyncHttp

I'm going to upload multiple photo/video using LoopJ AndroidAsyncHttp to server. My problem is i need to add cancel button for each of the photo and allow the user to cancel the uploading. May i know anyone got the solution for this? or any others…
micky
  • 235
  • 2
  • 4
  • 16
0
votes
1 answer

Executting http request parallel y by using Android Asynchronous Http Client library

In my android application, I have to get almost 50 data (50 AsyncTask) from server parallel y. So I implemented my logic by using executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);. And I read about executeOnExecutor which can run only 5 AsyncTask…
0
votes
1 answer

Android-Async-Http Library post error?

I am currently using android-async-http library to send a post/get requests. I didn't have any problem before but now i realize that it gives me timeout error if i send this request without image data. (There is no error if i send exact same request…
yahya
  • 4,810
  • 3
  • 41
  • 58
0
votes
2 answers

loopj android-async-http client causes app to crash with nullPointerException

I'm using AsyncHTTPClient(loopj.com/android-async-http/) in my app to excess json api. It works fine except when the user presses back button before asynchttpclient completes its work. It crashes the app. Here is my onFinish() method code.…
lightsaber
  • 1,481
  • 18
  • 37
0
votes
1 answer

AsyncHttpResponseHandler for get an xml

I'm developing an app for Android. I made a class to parse an xml, when I load a local xml file it works, now I want to load an xml file from a web site. So I thought to use AsyncHttpClient to get the xml file and pass it to my parser. I made it…
user2478615
0
votes
1 answer

Load local json file with image url in Android

I am using a source for image loading from url. The image links are stored in a json file and the json file to be hosted in a server. But I want the json file to store locally may be in assets or drawable. My problem is if i use asset manager, it…
0
votes
1 answer

AsyncHttpClient not passing the value to php

Hi i am using php to connect my android app to mysql but the get method is not passing the value to the php file. This is my code. private void executeAjaxRequest(){ String url = mDataUrl+"?request="+mRequest+"&outlet_id="+mOutletID; …
user1881440
0
votes
0 answers

How to upload a file using AsyncHttpClient with basicAuth?

the request must be post type, and when I tried AsyncHttpClient returns me ClientProtocolException Caused by NonRepeatableRequestException my code: if (checkIfClientIsReady(act)) { try { RequestParams params = new…
letroll
  • 1,059
  • 1
  • 14
  • 36
0
votes
4 answers

Android - Choosing HTTP Java library

I'm building an Android app that will communicate with a REST service using HTTP and HTTPS for downloading JSON and file data. I'm looking for a HTTP networking library to use and am evaluating options. I've found one called AsyncHttpClient…
Jonathan Wareham
  • 3,357
  • 7
  • 46
  • 82
0
votes
2 answers

AsyncHttpClient not working

I have the following timer in onCreate(): new Timer().scheduleAtFixedRate(new TimerTask(){ public void run() { Log.i("EOH","timer"); updateMarkers(); }}, 0, 1000); As you can see, it calls the…
Eamorr
  • 9,872
  • 34
  • 125
  • 209
-1
votes
2 answers

Sending ArrayList to server not working with AsyncHttp

HttpAsyncRequest request = new HttpAsyncRequest( MapsActivity.this, Constant.BaseUrl, HttpAsyncRequest.RequestType.GET, …
-1
votes
2 answers

basic tutorials for LoopJ AndroidAsyncHttp

I am newbie in networking side and want to learn how LoopJ AndroidAsyncHttp works,i have got project downloaded and got it working after building. Now i am loogkin for any links or tutorials for LoopJ AndroidAsyncHttp to get basic idea before i…
Pratswinz
  • 1,476
  • 11
  • 24
-1
votes
1 answer

Is android-asynct-http library coupled with UI thread?

I want to use this awesome library for my server request in my application to do some work on map. My need is I want to make server request for every 2 minutes without block user interaction on the screen while server requesting process happening…
M.A.Murali
  • 9,988
  • 36
  • 105
  • 182
-1
votes
2 answers

Java: Accessing a String outside of a function

I am a hobby programmer and am trying to access returnJson outside of the onSuccess function. Inside of the function, I can see that it returns as expected. Could somebody explain why I cannot view it outside and what I can do to make it accessible…
AWippler
  • 417
  • 3
  • 9
  • 16
1 2 3
17
18