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

Loopj's AsyncHttpclient not setting the correct timeout

I tried setting my asynchttpclient's timeout in my singleton class but it seems that it doesn't change. I got the 10000 which I think is the default value. client.setMaxRetriesAndTimeout(0,5000); Log.i("loopj", ""+ client.getTimeout()); EDIT:…
dgzz
  • 2,929
  • 6
  • 34
  • 56
5
votes
0 answers

Android MediaPlayer default timeout

Does anybody know, what is the default timeout for the MediaPlayer class of Android, when using a HTTP URL as source? So far as I searched, it is not possible to set this timeout (unlike in HttpURLConnection), and only get information about it by…
4
votes
0 answers

Android HttpURLConnection call starts to fail at 20:00 2021-09-29 with website using Let's Encrypt certificate

A website uses Let's Encrypt SSL certificate. An Android app calls an API of this website. It worked perfectly until around 20:00 2021-09-29 UTC URL url = new URL("https://my.domain.com/Home/api/path"); HttpURLConnection huc = (HttpURLConnection)…
Hong
  • 17,643
  • 21
  • 81
  • 142
4
votes
3 answers

Cannot Resolve Symbol HttpEntity,HttpResponse

I am trying to learn XML parsing using this tutorial but some of the classes are not getting imported. Here is the code: public String getXmlFromUrl(String url) { String xml = null; try { // defaultHttpClient …
vasanth
  • 395
  • 1
  • 3
  • 22
4
votes
1 answer

Post fields in this format with Retrofit

So I need to send an API request in this format { "access_key": "6477848488cchfc47488", "person": { "first_name": "John", "last_name": "Henry", "email": "john@henry.com" } } I have created an…
Amanni
  • 1,924
  • 6
  • 31
  • 51
4
votes
2 answers

HttpClientBuilder missing on Android?

Apache has deprecated DefaultHttpClient, but it seems this is not the case for Android, see also here Deprecated Java HttpClient - How hard can it be? Importing org.apache.httpcomponents:httpclient:4.3.5 instead of new DefaultHttpClient(); I…
Oliver Hausler
  • 4,900
  • 4
  • 35
  • 70
4
votes
2 answers

Android: downloading a file and saving on sd card

Was trying to create an application to download a file on SD card, here is my code.: public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
Varun Parikh
  • 131
  • 2
  • 3
  • 11
4
votes
1 answer

What to do with never happening, useless exceptions?

I have this code: HttpPut put = new HttpPut(url); try { put.setEntity(new StringEntity(body, "UTF-8")); } catch (UnsupportedEncodingException e1) { // That would really not be good e1.printStackTrace(); } On a platform that is known to…
njzk2
  • 38,969
  • 7
  • 69
  • 107
4
votes
1 answer

Using cURL commands in Android

I have the following cURL command and I would like to execute the same thing from Android, curl -X POST -H "Content-Type: application/json" -d '{"username":"user","password":"pass"}' http://www.somesite.com/login This is what I made for…
Falling Into Infinity
  • 697
  • 3
  • 13
  • 34
4
votes
1 answer

Sending Multipart/Form request with multiple parameters?

I am trying to upload a picture to a server and i am getting different responses from the server depending upon the entity that i am sending. When i send FileBody fb = new FileBody(new File(filePath), "image/jpeg"); StringBody contentString = new…
4
votes
0 answers

Can I use a single AndroidHttpClient instance for multiple calls simultaneously

AndroidHttpClient is said to be thread safe. Just to make sure - does it means that I can use a single client instance in my app for all the HTTP requests? Is there a reason not to do so? In its source code, I noticed that it uses BasicHttpContext…
4
votes
3 answers

Is AndroidHttpClient thread safe

I was wondering, whether is AndroidHttpClient thread safe, as this is not being mentioned in documentation. Means, a single instance of AndroidHttpClient can be shared among multiple threads.
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875
3
votes
1 answer

Theta V wifi api inconsitency

I'm implementing some functionality using the Ricoh Theta V device. It is the most basic functionality for the device that I can think of but using the api is so inconsistent, and the device keeps going off after a few minutes. I just want to take…
Filled Stacks
  • 4,116
  • 1
  • 23
  • 36
3
votes
1 answer

Http URL Connection unable to handle redirects

I'm trying to open a connection with the help of HttpURLConnection class. I've tried this code to handle a URL, but on seeing Logs, I find that it's unable to get the redirected URLs. In the sample code, you will see that to get the URL, I'm using a…
3
votes
0 answers

Android - App in Power Saving Mode fails to connect to the internet while not in foreground

I have an app which I wake up using GCM notification and make it connect to the server via an https connection. I noticed on recent android OS that when my app enters power saving mode ("apps that have not been used for more than 3 days have been…
1 2
3
27 28