Reputation: 13
I have a issue. My application is running in the background (like a foreground service) on some android devices (Android versions from 5 to 6). The application is connected to the server (TCP connection) and they are exchanging data at least every 45 seconds.
If the screen is turned off and the mobile is not used then it seems that android turn off the mobile data after 1 hour. Thereafter the application is not able to reconnect to the server. The devices are running on the battery power. As soon as the screen is on then the mobile data is again on and the application reconnects to the server.
I have turned off power save options.
Can somebody give me some hint about what I can do in order to prevent turning off the mobile data when the phone is sleeping. Thanks
Upvotes: 1
Views: 483
Reputation: 5949
You can whitelist applications to partially ignore Doze and App Standby. Each user must take action to activate this on their phone.
You have not stated what this application does, but if it's a general audience application, you should not be sending data every 45 seconds all the time because it will give users very poor battery life. Part of the reason Doze exists is to prevent poorly written applications from wasting battery.
Upvotes: 1