[DEV][QUESTION] 3rd Party Alarm Apps Guide & FAQs: Samsung Nougat update, Doze Mode, Battery Optimization, Battery Manager, Autostart, oh my...

Android 3rd party alarm app users of Reddit... I need your help. I'm the Android developer for an alarm app called Rooster. We're a small team from South Africa, and I think we've done a pretty solid job of handling all the different Android API levels, devices types, etc. but eventually it gets out of hand handling all of these optimizations layered on top of each other - for example: Samsung Nougat phones with Unmonitored Apps list, as well as Doze mode, and Huawei phones with the Battery Manager whitelist. I've seen a number of the current top alarm apps struggling with similar issues based on user reviews and posts, yet only Sleep as Android has propper FAQs and then only on their website, and no in-app guide for alarm failures as far as I can see.Here is what I'm trying to do:Create a comprehensive FAQs page with known issues categorized by device type and Android version.Detect alarm failures - specifically due to intents not firing at all, content not downloading in background, content streaming, service not being allowed to start from background - and then briefly explain the issue to users using a SnackBar which directs them to the FAQs page and attempts to take them directly to the correct settings page...Expand on our first use guide for alarm failures. We currently have the Snackbar feedback working, although it can be expanded, and is not yet linked to our FAQs page.Work in progress FAQs page - http://faqs-android.s3-website-us-east-1.amazonaws.com/. For this to work, we need:Technically capable users to use Rooster, and get it working while giving feedback on any issues they have with battery saving features etc.Users to try the app on their phones, and see that the FAQs page is accurate in solving their issues. Debugging these issues is especially difficult without tech savvy Android users who understand what's going on! We have recently been getting reports of the following:Alarm content not downloading, and a default alarm playing.Alarm intents firing and starting broadcast receiver, but services not starting.Alarms intents not firing at all (OS level power use optimization).Alarms firing, and activating, but no sound being heard.Technically, here are the methods we use to set alarms, download content, and activate alarms (hopefully useful for future alarm app developers): Lollipop and above: + AlarmManager setAlarmClock() methodKitKat and above: + AlarmManager setExact() method with AlarmManager.RTC_WAKEUP typeOthers: + AlarmManager set() method with AlarmManager.RTC_WAKEUP typeDownloading content: We use a SyncAdapter that is registered with the Android system. This is run periodically, and it checks if the content is "fresh".Activating alarm: A broadcast receiver for the AlarmManager pending intent, which starts a service using startForegroundService() for Android Oreo, and startService() for others. This service then handles all the alarm activation stuff like starting the UI and audio etc. Currently, the following device have explainers when you set your first alarm, guiding you about how to protect the app:Huawei: attempts to take you directly to Battery Manager settingsXiaomi: directs you to the Battery Optimization menuSony: directs you to the Autostart option for the appSamsung with Nougat: attempts to take you directly to Unmonitored Apps listZTE: directs you to the Power Manager settings As you can see, it can get quite complex handling all of these, and most of the devices don't offer open APIs to take the user directly to the correct settings page...From "Sleep as Android" website, one of the most popular Android alarms at the moment:The core of the problemSmartphones are getting more and more powerful, but the battery capacity is lagging behind. Vendors are always trying to squeeze some battery saving features into the firmware with any new Android release. With Android 6 (Marshmallow), Google has introduced Doze mode to the base Android, in an attempt to unify battery saving across the various Android phones.Unfortunately, vendors such as Samsung, Huawei, OnePlus (and more) did not seem to catch that ball and they all have their own battery savers, usually very poorly written, saving battery only superficially.These battery saving features have lots of side effects. They usually kill long running processes – but don’t care whether the user wants the process to run or not (think sleep tracking). They also impose arbitrary limits on random things – like how many times can you schedule an alarm during the night. If you go over the limit – boom! No alarm in the morning! That’s what you get for not reading the documentation on vendor modifications (oh wait, there is no documentation). How to prevent the alarm and sleep tracking from failing? Opt out of the battery savers.TL;DR: The Rooster alarm team would be very grateful for users who can assist in the following way, to combat proprietry battery saving software killing our alarms:Use the Rooster app, and give feedback on our work in progress FAQs guide for solving alarm failures.Use the Rooster app, and give feedback on any issues you encounter relating to battery saving, whitelists etc., that aren't featured in our FAQs guide - any help us create an FAQ entry for that issue. This will not only help us, but also any future users of third party alarm apps!A big thanks to the /r/androidapps reddit users who helped us so much last time! :)

Android 3rd party alarm app users of Reddit... I need your help. I'm the Android developer for an alarm app called Rooster.

 

We're a small team from South Africa, and I think we've done a pretty solid job of handling all the different Android API levels, devices types, etc. but eventually it gets out of hand handling all of these optimizations layered on top of each other - for example: Samsung Nougat phones with Unmonitored Apps list, as well as Doze mode, and Huawei phones with the Battery Manager whitelist.

 

I've seen a number of the current top alarm apps struggling with similar issues based on user reviews and posts, yet only Sleep as Android has propper FAQs and then only on their website, and no in-app guide for alarm failures as far as I can see.


Here is what I'm trying to do:

  1. Create a comprehensive FAQs page with known issues categorized by device type and Android version.
  2. Detect alarm failures - specifically due to intents not firing at all, content not downloading in background, content streaming, service not being allowed to start from background - and then briefly explain the issue to users using a SnackBar which directs them to the FAQs page and attempts to take them directly to the correct settings page...
  3. Expand on our first use guide for alarm failures.

 

We currently have the Snackbar feedback working, although it can be expanded, and is not yet linked to our FAQs page.

Work in progress FAQs page - http://faqs-android.s3-website-us-east-1.amazonaws.com/.

 

For this to work, we need:

  1. Technically capable users to use Rooster, and get it working while giving feedback on any issues they have with battery saving features etc.
  2. Users to try the app on their phones, and see that the FAQs page is accurate in solving their issues.

 

Debugging these issues is especially difficult without tech savvy Android users who understand what's going on! We have recently been getting reports of the following:

  1. Alarm content not downloading, and a default alarm playing.
  2. Alarm intents firing and starting broadcast receiver, but services not starting.
  3. Alarms intents not firing at all (OS level power use optimization).
  4. Alarms firing, and activating, but no sound being heard.

Technically, here are the methods we use to set alarms, download content, and activate alarms (hopefully useful for future alarm app developers):

 

Lollipop and above: + AlarmManager setAlarmClock() method

KitKat and above: + AlarmManager setExact() method with AlarmManager.RTC_WAKEUP type

Others: + AlarmManager set() method with AlarmManager.RTC_WAKEUP type

Downloading content: We use a SyncAdapter that is registered with the Android system. This is run periodically, and it checks if the content is "fresh".

Activating alarm: A broadcast receiver for the AlarmManager pending intent, which starts a service using startForegroundService() for Android Oreo, and startService() for others. This service then handles all the alarm activation stuff like starting the UI and audio etc.

 

Currently, the following device have explainers when you set your first alarm, guiding you about how to protect the app:

  • Huawei: attempts to take you directly to Battery Manager settings
  • Xiaomi: directs you to the Battery Optimization menu
  • Sony: directs you to the Autostart option for the app
  • Samsung with Nougat: attempts to take you directly to Unmonitored Apps list
  • ZTE: directs you to the Power Manager settings

 

As you can see, it can get quite complex handling all of these, and most of the devices don't offer open APIs to take the user directly to the correct settings page...


From "Sleep as Android" website, one of the most popular Android alarms at the moment:

The core of the problem

Smartphones are getting more and more powerful, but the battery capacity is lagging behind. Vendors are always trying to squeeze some battery saving features into the firmware with any new Android release. With Android 6 (Marshmallow), Google has introduced Doze mode to the base Android, in an attempt to unify battery saving across the various Android phones.

Unfortunately, vendors such as Samsung, Huawei, OnePlus (and more) did not seem to catch that ball and they all have their own battery savers, usually very poorly written, saving battery only superficially.

These battery saving features have lots of side effects. They usually kill long running processes – but don’t care whether the user wants the process to run or not (think sleep tracking). They also impose arbitrary limits on random things – like how many times can you schedule an alarm during the night. If you go over the limit – boom! No alarm in the morning! That’s what you get for not reading the documentation on vendor modifications (oh wait, there is no documentation). How to prevent the alarm and sleep tracking from failing? Opt out of the battery savers.


TL;DR: The Rooster alarm team would be very grateful for users who can assist in the following way, to combat proprietry battery saving software killing our alarms:

  1. Use the Rooster app, and give feedback on our work in progress FAQs guide for solving alarm failures.
  2. Use the Rooster app, and give feedback on any issues you encounter relating to battery saving, whitelists etc., that aren't featured in our FAQs guide - any help us create an FAQ entry for that issue.

 

This will not only help us, but also any future users of third party alarm apps!

A big thanks to the /r/androidapps reddit users who helped us so much last time! :)

http://ift.tt/eA8V8J