HttpClient on Android using Wifi causes delay (on initial request)?

There is a problem with the ssl stack included with android. I struggled with this as well. Go to the apache home, and get the org.apache.

Http java package (I used v4.1). Include that in your application and use the HttpClient from it directly, instead of using the HttpClient built into Android, and your SSL Handshake delay problem will be resolved.

This does not seem to work, unfortunately. Also, why would it work over 3G and not wifi if this would be the problem? :/ – Joakim Berglund Apr 26 at 19:01 Hmm... What I saw was that on wifi, the SSL Handshake delay was much more obvious simply due to the speed of the connection, whereas other latency issues on 3G masked the time.

I saw some very strange and inconsistent behaviors on wifi vs. 3G, on multiple devices. Noteably, we had no problems at all on os 1.6 on the Backflip, just as you described. From your descirption of 1st-time problems, you must be reusing your HttpClient, which is good, but it again points to SSL handshake being the time-sink, as that does not need to be performed on each request.

– Tyvin Apr 26 at 19:26 Hmm, alright. Just to make sure I add httpclient. Apr 26.

Jar, httpcore-4.1.Jar and httpmime-Apr 26. Jar correctly... The only thing I need to do is add them to build path, right? – Joakim Berglund Apr 26 at 19:32 Wierd thing is, if I try api.myphotodiary.Com over wifi, I get 10 second delays on first request, however if I try some graph.facebook.

Com url I get 500ms at tops on all requests. Both over SSL :/ This problem is really starting to confuse me... – Joakim Berglund Apr 26 at 19:38 You could include the jar, but you may want to get the source, so you only need to include the specific classes, to keep app size down. Then make sure you import the org.apache.http.

V4_1.client. HttpClient and related classes directly, so the app won't use the built-in. I hope this helps for you!

– Tyvin Apr 26 at 19:40.

Disable DNS Relay on your router! It just worked for me! Also, no version of httpclient or httpcore changed it for me.

I'm having this wierd problem with HttpClient on Android. If I try to connect to a https url using WiFi I'm having a delay before the acctual request is sent. If I send the request over 3G the delay does not exist.

It does however, only occur on Android 2.2 and 2.3, If I run it on for example 2.1-update1 it works fine on wifi as well. However, when sending requests right after the initial request - it works properly on Wifi as well - but only for a while. The line where the delay occurs is HttpManager.

Execute(httpget); which also is the line I calculate the ms on. Has anyone ever been facing this problem? I find this delay very annoying, and so will my users.

Emulators behave the same way as an Xperia Mini Pro running 2.1-update1 where it works properly over Wifi, and a HTC Desire running CyanogenMod 7 (2.3) where it doesn't work properly.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions