Questions tagged [androidhttpclient]

Implementation of the Apache DefaultHttpClient that is configured with reasonable default settings and registered schemes for Android This class was deprecated in API level 22 (Android 5.1). Please use URLConnection and friends instead. The Apache HTTP client is no longer maintained and may be removed in a future release. Please visit this webpage for further details.

Implementation of the Apache DefaultHttpClient that is configured with reasonable default settings and registered schemes for Android.

Warning: This class was deprecated in API level 22 (Android 5.1).
Please use URLConnection and friends instead. The Apache HTTP client is no longer maintained and may be removed in a future release. Please visit this webpage for further details.

Useful links

418 questions
1
vote
1 answer

Heavy HTTP requests from Android makes the network disconnected. How to solve this?

I got a very annoying problem now with my android development. I have a list which loading a bunch of content, each is an xml file with different address. Which means I need to sends bunch of http get request to server. The problem if the request…
1
vote
2 answers

Prevent java.lang.IllegalArgumentException: Host name may not be null

When executing an HttpUriRequest using the AndroidHttpClient, it will throw an java.lang.IllegalArgumentException: Host name may not be null when the url is faulty. In my application, the user can input his own url. When for example…
nhaarman
  • 98,571
  • 55
  • 246
  • 278
1
vote
0 answers

Handle response properly when used HttpClient

I am developing a android app where I am using Zend framework to build APIs. I am calling API using this code. This is code in IntentService class. HttpClient client = new DefaultHttpClient(); // Set timeout values …
keen
  • 3,001
  • 4
  • 34
  • 59
1
vote
0 answers

"Stub!" error when mocking HTTP requests with Robolectric

I have a test class annotated with @RunWith(RobolectricTestRunner.class). All tests fail on the following line: Robolectric.addPendingHttpResponse(200, " ... "); This is how the failure looks like: java.lang.RuntimeException: Stub! at…
Ilya Kogan
  • 21,995
  • 15
  • 85
  • 141
1
vote
1 answer

Android - AQuery get image on callback method

Hi I have a request URL (Google Places Request URL) and the response I get is a image. How can I get the image on callback function? Update AQuery aQuery = new AQuery(getApplicationContext()); String urlString =…
1
vote
3 answers

Uploading Image to Server - Android

I have got the Rest Api's link and the sample code for uploading the image in C sharp but how to upload image to server from android the same thing using java Here's that sample code http://xx.xx.xxx.xx/restservice/photos Sample code for uploading…
user1169079
  • 3,053
  • 5
  • 42
  • 71
1
vote
2 answers

Using excessive amount of network calls in android

I am developing an android application that needs to communicate a lot with a remote server. For this task I wrote a class that handles all the network communication. Do I need to make for every single method as an Asynctask? What about methods…
crazyPixel
  • 2,301
  • 5
  • 24
  • 48
1
vote
1 answer

AndroidHTTPResponse returns clipped content

I am using the following piece of code to perform an HTTP Request in Android. Everything seems fine, but it appears that the response gets clipped at some point and I can't read the full content of the requested url. Is there any size limit on the…
1
vote
1 answer

Android async http Internal Server Error

I'm send a post request using Android async http and it seems that the response is null. I think it's because onSuccess of AsyncHttpResponseHandler doesn't get called. Here is my post request: final String response[] = new…
dgzz
  • 2,929
  • 6
  • 34
  • 56
1
vote
2 answers

How to read HTTP response using AsyncTask?

I am having difficulty trying to get the body of the HTTP response from the string. So according to my code, I should have response from the PHP page in the string called "responseString" however because this is in an ASynchTask, I can not access…
1
vote
3 answers

A good approach to do multipart file upload in Android

I am working on a piece of code to do multipart form data POST request, which in my case is just to upload an image to server with parameters. Here's what I have now: I have a button to trigger the multipart request, in the button OnClickListener, I…
Allan Jiang
  • 11,063
  • 27
  • 104
  • 165
1
vote
4 answers

how can i check internet connectivity before executing HTTPClient

I am creating android app that call rest services made by me on server and server is ruuning live but due to internet connectivity issues some time my application runs successfully but sometime it crashes. The code for my connection class is…
Naveed Yousaf
  • 133
  • 2
  • 13
1
vote
1 answer

Post data AsyncTask won't execute android

I have this simple code where i do post to a server some data. As this is happening on click where i call the function that starts the asyncTask like this: save.setOnClickListener(new OnClickListener() { @Override public void…
Darko Petkovski
  • 3,892
  • 13
  • 53
  • 117
1
vote
3 answers

Android org.apache.http.client.HttpResponseException: Not Found

In my app I send user information to server with http as follows, I get org.apache.http.client.HttpResponseException: Not Found and I have spend more time but could not solution.please help me find out the solution. I get error at this…
M.A.Murali
  • 9,988
  • 36
  • 105
  • 182
1
vote
1 answer

show upload progress for JSON

I have the following piece of code and I would want to add a feature in here such that I know when the JSON content is uploaded. I am uploading a JSON content. @Override protected String doInBackground(JSONObject... params) { // TODO…
Rakeeb Rajbhandari
  • 5,043
  • 6
  • 43
  • 74