Same thing here. The first request (for both POST and GET) takes up to a couple seconds and then all requests afterwards take much shorter (less than half a second!).
Any ideas? On Jan 23, 4:31 pm, Yuvi <yuvidr...@gmail.com> 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en