I want to post some data every 5 min to server,
but when I lock the screen, the network is offline and I’m not sure my service is running.
The connection is not only WIFI but also GPRS and 3G.
anyone solve this question?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should use WifiLock. The the connection will not be lost even if the screen goes dark. If you want to use 3G,look here, particulary at answer by CommonsWare, you should use partial WakeLock then.