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
2 answers

Right way to manage HTTP connection in Android

I have written two programs which handle the HTTP request. I wanted to know if one is better than other - Program 1 (Using HttpURLConnection) URL url = new URL("https://www.google.com/"); HttpURLConnection connection =…
Fox
  • 9,384
  • 13
  • 42
  • 63
1
vote
0 answers

Httpget with cookie android

I am trying to get a json string from a webservice. I have successfully login and saved a cookie in my sharepreference. the cookie is then passed to the getMyAdverts method with a url/path to retrieve the json data. Here is my method. public static…
Dimitri
  • 1,924
  • 9
  • 43
  • 65
1
vote
0 answers

Android An exception occurred: java.lang.IllegalStateException on HttpResponse get Request

I have an android application which is using rest service . when I send any post/get request to rest service , operation is completing on rest server and server response 200 ok. But I when i try to get response body, i get the following error. "…
ilhan
  • 125
  • 2
  • 13
1
vote
1 answer

Android: how to limit download speed

I use AndroidHttpClient to download videos from internet. There are ways to increase download speed, but I want to know how to slow down the download speed using AndroidHttpClient or HttpURLConnection ? Is there any interfaces or configuration for…
mianlaoshu
  • 2,342
  • 3
  • 27
  • 48
1
vote
1 answer

HttpHostConnectException - How can I catch it right?

I have a HttpHostConnectException... That is okay, because the server is offline. So I want to mange to catch this exception for the situation, the server will be down. But if I use catch (HttpHostConnectException e){ …
Bolic
  • 705
  • 2
  • 12
  • 30
1
vote
1 answer

Android : Failed to Upload Large files from android

I need to upload large sized zip file (approx above 10 MB) to server from Android device. I can upload less then 8 MB , while trying to upload above 10 MB it throws "OutOfMemoryError", so I…
AndHobbiest
  • 131
  • 1
  • 1
  • 8
1
vote
2 answers

How to reference a external lib/jar in Android project

I have this same problem - How to reference an external jar in an Android Library project in IntelliJ v10 ...but the solution does not work for me. I keep getting this error E/AndroidRuntime: FATAL EXCEPTION: main …
kapso
  • 11,703
  • 16
  • 58
  • 76
1
vote
1 answer

Is it possible to use AndroidHttpClient with PersistentCookieStore?

I would like to use AndroidHttpClient instead of DefaultHttpClient. In the documentation is say: This client processes cookies but does not retain them by default. To retain cookies, simply add a cookie store to the…
1
vote
1 answer

Can't get the whole souce of a page in android

i'd just wanted to get the source of the page for parsing data. I used the following code public static String getPageSourceFromUrl(String Url) { String text = ""; try { HttpClient client = new DefaultHttpClient(); …
Trần Đức Anh
  • 127
  • 1
  • 2
  • 12
0
votes
0 answers

Http GET not working on Android 11+ | Flutter

My app needs to connect to an access point, and after the connection make an http GET to know the version of the device. The connection to the AP works good. When is time to make the http call, i always get check WS error: SocketException:…
giordy16
  • 275
  • 1
  • 12
0
votes
0 answers

Android Retrofit throwing exception instead of showing response

My following code throws an exception instead of showing the response: fun getRoadStatus(roadName: String) { // Couroutine to fetch data from the API viewModelScope.launch { try{ _busy.value = true …
Damandroid
  • 756
  • 9
  • 31
0
votes
0 answers

How to solve error on HttpURLConnection in android with URL having special characters?

I am trying to call a get API call using HttpURLConnection in android. I am passing some values as headers on the URL. This API returns not found response if that value contains special characters like & and #. All other special characters working…
Malhotra
  • 221
  • 3
  • 13
0
votes
2 answers

Android post image to php server always fail

Thanks to everyone who helped me. Here is my success method, use post method to post two parameter(no, key) and image file to php server. Hope can help other in need. static String postUploadImageToPHPServer(String URL, String no, String key, String…
playground
  • 115
  • 1
  • 13
0
votes
1 answer

android studio use cleartext http on api 17

I am using xammp server for php on localhost , i was working before update (i think), but now http connection gives me an exception: W/System.err: java.io.IOException: Cleartext HTTP traffic to 192.168.0.105 not permitted i have tried then to add…
user13454602
0
votes
2 answers

Getting response code from volley error response

How do we get response code and message of an errenous response from client? Here error.toString() returns: com.android.volley.ServerError error.getMEssage(): null error.getCause(): null parseNetworkResponse: never ever enters that function. When I…
Sahin
  • 1,032
  • 14
  • 23