Sunday, April 29, 2018

Doze causes issue or fix?

From Android 6.0, Google introduces Doze to reduce battery usage by deferring background task and network activity for apps.
That means any app that has background task and network activity of the background task may work abnormally (more details from Google here: https://developer.android.com/training /monitoring-device-state/doze-standby.html).

So, this is good or bad?

If any app that don't have background task, no issue for those apps.

But for our Marketing 24/7 apps app, this is a big problem because has a lot background tasks like schedule (email and sms), backup to dropbox .... those all tasks need network connection while device idle. Doze will kill all of those tasks and make this app doesn't work when device idle.

Luckily that Google still provide a way to add an app to Battery Optimizations exceptions whitelist. That means Doze won't do anything for these apps. Any app in the whitelist works the same when device idle or active.

Below are steps to added this app to whitelist on Samsung Phone:

- Step 1: Open battery settings from phone settings.


- Step 2: Click Battery icon/button on Device Maintenance screen

- Step 3: On battery screen, click Battery Usage button to open battery usage screen


- Step 4: On battery usage screen, click menu button and click Optimize battery usage menu item


- Step 5: On Optimize battery usage screen, select All apps -> scroll to find iMarketing Center -> and turn switcher to off, it means don't optimize battery usage for iMarketing Center app, Doze doesn't do anything with this app, background task, background network work normally.

That's all to add an app to battery optimization whitelist.

Also phone may suggest to put this app to sleeping apps, that'll cause issue too, you should add this app to unmonitored sleeping apps app (from battery screen).

That's all to completely by pass Doze.

Thanks for reading, any questions, please give comment.

No comments:

Post a Comment