开发者

Android HttpPost socket timeout when android goes to sleep in background service

I have an android app that uses a background service for uploading data.

When we go upload data, everything works fine. Even w开发者_StackOverflow社区hen we make the display sleep, everything works.

However, this was while we were connected to Eclipse via USB. Once we disconnected the device, started to send the data and made the screen 'sleep,' we got a socket timeout exception.

Is there a special setting in the Service I need to make to allow it to continue to send data when the display sleeps?


Is there a special setting in the Service I need to make to allow it to continue to send data when the display sleeps?

You need to hold a WakeLock. And, if you are connected via WiFi, you will need to hold a WifiLock.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜