Why do you not get your notification, alarm or updated status on Android?
Permanent analysis or processing is almost impossible on the Android
The phone manufacturers try their best to make their phones last on the battery as long as the battery permits. They customise the hardware, implement as large battery as possible and customise the Android.
The design of the Android changes from manufacturer to manufacturer because they provide their custom launcher. The user’s experience is created based on this launcher. If you are a bit power user, you go to Google Play Store, download 3rd party launcher and customise the experience.
Unfortunately, these changes are only the tip of the iceberg. Android is an open-source project, so the manufacturer can copy the system and make required customisations to make it work on their hardware. In most cases, the implementation of hardware drivers would be enough to make it work. This would be called “Stock Android”, which can be found on Pixel devices and other smartphones.
Photo by Daniel Romero on Unsplash
However, manufacturers do not stop at this point. They want to implement more features to satisfy their customers. To make this, they go deeper into the system.
Illustrative story
You got bored of your alarm clock on your phone. So, you went to Google Play Store, crossed multiple alarm clock applications and found a new fantastic app. You set up the new alarm clock to wake you up for work and went to sleep. You wake up, go for coffee and you realise…
I am late for work because that alarm did not wake me up!
After coming back from work, frustrated, you uninstall the new app and continue with the stock app on the phone. Furthermore, you go to Google Play Store and give the app 1* that it does not work.
You are unhappy. The developer is unhappy and is even confused at this point.
What happened in reality?
The issue with the app is not always bilateral — it is not only you or the developer. Phone manufacturers can be blamed on the same terms.
The manufacturers always try to squeeze as much battery life as possible. They interfere with the working of Android apps. The stock Android provides battery-saving routines like the Dose regime and others. The developers are aware of them and take them into account during the development. However, the manufacturers tamper with these routines and add extra processes, which kill or freeze the apps. They remove alarms from the alarm manager, halt the provision of sensor samples or stop background work. The developer does not have the opportunity to evade it.
What did happen in our story in reality? The app worked as it should have because, on Google Play, you can find multiple satisfied users. The case is that your phone removed the alarm to save battery. The app does not know about it because the customised Android did it behind the scene.
Preinstalled apps and popular apps work all the time because they usually are white-listed by the manufacturer of the device.
Do not get me wrong. In many cases, the causious approaches towards battery life is beneficial for the user. Mistake in the app or abusive app should not cause battery drianage. But, battery routines can ruin experience of healthy apps.
Other situations that can go wrong
The app regularly goes to check up on the internet if you do not have new mail or message. The phone can dose your app. The app will not take any further actions till you turn on the phone. You will not get your notification about a new message. Victims: social media apps, messaging apps.
You wait for your long-term work to be finished on your phone, like processing video or something similar. You turn off the display and put it on a table in the hope, that it will finish the work in the future. However, you come back and the process is at the same point. Once again, the phone froze your app to save battery and will continue only if the screen is on. Victims: long-term processing apps.
You track your position or do something with sensors in the phone. To save battery, the phone will start to lower the sampling frequencies of the sensors or will completely cut you off the sensors. Even wake-up sensors can be turned off. They come back when you turn on the screen once again. Victims: sport tracking apps or emergency apps.
You set up an alarm to drink water every two hours or take pills every morning. But the notification does come because the phone removed the alarm in the registry (story). Victims: alarm clocks, medication intake apps and other similar.
The phone is fully operational if you turn on the display/connect it to electric grid. The functioning of all apps can be guaranteed. Turning off the display without charning the phone initiates the battery-saving routines and can ruin the experience.
What can you do about it?
As user
You can go to the phone settings and turn off some battery-saving settings for apps. Every manufacturer has some different kind of handling it.
To have an idea, of what is happening or what to do with your phone, go to the link below. The website describes how severe is the background processing touched and what can be done about it. Dont kill my app
Before giving the 1* to the developers, try to contact them. They will be happy to help you out. In the worst case, they will eliminate your phone at Google Play for their app. Other users with the same phone will not be able to download the app and will not encounter the same issue related to the specific phone.
As developer
If some feature requires notifications, looking up at the internet or small work to do, you can use WorkManager. The framework will handle your actions appropriately. Follow the link - Workmanager
However, avoid infinite background processes and use wake-up methods whenever possible.
As manufacturer
Align with the dose regime in the Android. Do not add extra routines, which can be inconsistent and ruin the user experience. Please and thank you.
Conclusion
The reason why I wrote this article is my app, which tried to tackle the issue of fall detection. The app cannot be released due to the lack of consistent behaviour of the sensors. The sensor samples do not come or the Android stops the app process completely.