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

AsyncHttpResponseHandler doesn't gets in its functions in the switch

i have a GCMIntentService class which extends from GCMBaseIntentService, in this class , in the onMessage function , i would like to call a AsyncHttpResponseHandler.But when i am calling this , /** * Method called on Receiving a new message from…
Alp
  • 1,863
  • 1
  • 20
  • 38
0
votes
0 answers

Android - AsyncHttp no response - BCrypt

i'm trying to register a user (from an Android app) to my server. For my website, it works well and i receive my JSON response. Into my app, when i send the request if all the data are good and the person is registered i do not get any…
maxime1992
  • 22,502
  • 10
  • 80
  • 121
0
votes
1 answer

Multiple calls using AsyncHttpResponseHandler

I am working on an app that loads a list of json data from a website, into a list. Within that list, each item has an image associated with it. The MediaAdapter works with each row, and calls an async load for each image. The issue comes…
Mark Headley
  • 376
  • 1
  • 4
0
votes
1 answer

Using LoopJ AndroidAsyncHttp to retrieve values

I've just started using the LoopJ AndroidAsyncHttp Library and its brilliant for data uploading. However, I'm now trying to get a response using a get request and I can't seem to understand why neither my onSuccess nor my onFailure methods are…
RohanC
  • 301
  • 1
  • 3
  • 12
0
votes
1 answer

Multiple Get Request not working properly

I am using following function but having AsyncTask Exception although I am getting valid response why is that so. public static void LoadServer(SharedPreferences prefs) { InputStream inputStream = null; String json = ""; String urlStr =…
0
votes
1 answer

Is it a bad practice to use AsyncHttpClient inside/with an AsyncTask?

I'm working on an Android app and there I have one Activity called InitActivity, where I send a request to the server in order register the user and update some data after the registration is completed. During this action I wanted to show a…
amsalk
  • 577
  • 1
  • 5
  • 23
0
votes
1 answer

AsyncHttpClient and org.apache.http.client fails on SSL site while standard Android method works well

There was recently certificate change on staging servers of my app. The server passes Qualys SSL test with grade A- ("The server does not support Forward Secrecy with the reference browsers. Grade reduced to A-") so I should be able to connect via…
Łukasz Sromek
  • 3,637
  • 3
  • 30
  • 43
0
votes
1 answer

Getting JSON random Object values

I'm trying to get json value form api. There is one object key that is dynamic so how can I solve it? I got json data as like in the picture. there is the numbers after "pages" that numbers are randomly changing and so how can I get that object…
0
votes
1 answer

com.loopj.android.http.RequestParams Don't works with put(String key, Object value)

RequestParams have put Object method,put(String key, Object value). so I use the code below; On the server, the userId cann't find in get or post paramenters. com.loopj.android.http.RequestParams params= new RequestParams (); //添加参数 add…
wei-song
  • 17
  • 5
0
votes
2 answers

build jar from loopj android-async-http source

I'm trying to build a jar from the https://github.com/loopj/android-async-http source code but have been unsuccessful. I also tried including the source as a library in my android project in android studio but was unable to. I want to build from…
chilicheech
  • 429
  • 4
  • 6
0
votes
1 answer

AsyncHttpClient with SSL protocol

I'm trying to create my first Android app and I have an issue. I have web service with https protocol, to get the data from the server I use AsyncHttpClient library, it has been working with http, but once I've changed it to https it's gives me an…
Greg
  • 25,317
  • 6
  • 53
  • 62
0
votes
1 answer

LoopJ AndroidAsyncHttp redirect not working

I have an android application where I have authentication and authorization services. Recently we had to change our URL's from http to https. I really don't want to resubmit app to the app store with urls changed to https. Main problem I am facing…
Oliver.Oakley
  • 628
  • 2
  • 7
  • 23
0
votes
1 answer

Loopj AsyncHttpResponseHandler store onSuccess response

I try to store the response string of the AsyncHttpResponseHandler in a class variable like this: public boolean isLatestVersion = true; private void requestServerVersionFile() { AsyncHttpClient client = new AsyncHttpClient(); …
S.Scherhak
  • 42
  • 5
0
votes
0 answers

How to initialize class with data from the internet and synchronize the class instance variables

I would like to apologize if this has a trivial answer but I can't seem to come up with a pattern/flow for this scenario. I am using Android Asynchronous Http Client which provides a callback for when its done with the request. I guess this is where…
Archon
  • 182
  • 9
0
votes
2 answers

Android async-http-client: Add parameters to callbacks?

I want to use async-http-client to post data to a server and keep a SQLite on device in sync with this data. So basically i want the whole thing to: Inert new data to the SQLite Post the new data to the server using async-http-client Update the…
homtg
  • 1,999
  • 1
  • 15
  • 20