I made the device which monitors person's health in sleep time and it connects to a smartphone via BLE.
It's working great with the iOS app. But since Doze mode came on Android world. It's really hard to deal with it because my device is working in his sleep time.
The main feature is that it detects particular danger and notify to the user while he is sleeping with the device. I need a network connection when it occurs.
Many articles tell me that I can use a network even in the doze mode if my app is in the whitelist. But it does not seem true after I tested Doze mode. Am I right?
I can ensure that I can find my app in the lists, when I fire
adb shell dumpsys deviceidle
What is the best approach that I can take to make my app working correctly?
- foreground services
- alarm manager with SetExactAndAllowWhileIdle.
- GCM (it means push, right?)
- anything else
Any tips will help me. Thanks.
Edit
Unfortunately, I tested with using GCM but it only wakes my app in short time. It means I have to send GCM as many as I want to keep it awake. I don't think I can use it.