Hi

we're experiencing the same thing - pretty much identical code
initial connection can take up to 30secs but subsequent connections
are only a sec or two

have reproduced on both 1.5 and 2.0 emulators as well as on devices
HTC Hero, Motoral Cliq and Droid

if we change the URL back to HTTP behavior is expected i.e a second or
two

Ronan

On Jan 23, 11:31 pm, Yuvi <[email protected]> wrote:
> Hi!
>
> I'm developing my first android app, which needs to make some http and https
> requests.
> I'm using the apache HttpClient. So far everything works fine...but I
> noticed something strange:
> almost every time I start the app, the first request is taking really a long
> time, while the next requests take much less. I tried executing the same
> request several times in a row, and with the same result.
>
> Here's part of the code I use to make an http request:
>
> HttpParams httpParams = new BasicHttpParams();
> HttpConnectionParams.setConnectionTimeout(httpParams, 30000);
> HttpConnectionParams.setSoTimeout(httpParams, 30000);
> client = new DefaultHttpClient(httpParams);
>
> try {
>     HttpGet getRequest = new HttpGet ("https://mip.sunrise.ch";);
>     HttpResponse response = client.execute(getRequest);
>     // ....
>
> } catch (Exception e) { }
>
> I tested the app on the various versions of the emulator, and on the htc
> hero (android 1.5). With the emulator with android 2.0 it seems that problem
> doesn't occur...mmm? hehe
>
> Someone has an idea of what am I doing wrong?
>
> Thanks!!
> Yuvi

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to