Reputation: 24
I'm creating an app that took coordinates every minutes and send to the server using service, but when app is in background and mobile is in idle mode it kill my service but when the phone is not in the power saving mode it doesn't kill my service, because of this scenario i have to disable the power saving mode...
Upvotes: 1
Views: 6860
Reputation: 21053
Unfortunately you can not do such thing. And after Marshmallow android introduce Doze behavior for battery optimization which was the biggest halt seems in android for user check this out here.
Please read the above link first before approaching further. And for more information the power saver mode behavior varies device to device. I myself tested in Samsung Grand and lenovo Vibe devices . Some of Devices will not allow services in background and any network access to the application. You can find work around for the problem in android documentation in above link
Upvotes: 2