I got it. Change WiFi sleep policy to NEVER. Settings.System.putInt(getContentResolver(), android.provider.Settings.System.WIFI_SLEEP_POLICY,android.provider.Settings.System.WIFI_SLEEP_POLICY_NEVER);
On Sunday, October 21, 2012 6:20:53 AM UTC-7, LouieLiu wrote: > > The app I am writing uses a Streaming (REST) api that opens a > HttpURLConnection and listens to a response from a server. > I use IntentService for this function so it runs in the background. > When my LG phone (ICS 4.03) goes dark (screen timeout), it terminates the > connection. But it works fine on my ASUS tablet (ICS 4.03) > and will continue to accept more responses from the server and process the > data. > > So I wrote a small app which uses a timer to make a Http request every 30 > seconds and then gets a response from the server. > For the LG phone, this app will continue to function as long as the screen > is on, but when the screen times out, it will stop the activity (timer) > but it will resume making Http request when the screen is back on. > But for the ASUS tablet the app will continue to make Http request > continuously even when the screen time out occurs. > > Are there settings that I am not aware of that allow opened network > connections to remain open and activities to continue to function when > the screen times out? > > Thanks > > > > -- 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