I have android app that communicates with the bluetooth device every second. I run communitation thread from Foreground process. All works fine when app is active but if app is not active after about 20 minutes I see that my app pings device every 20-30 seconds. Is there way for me to keep it at 1 second or its android system that puts app into this mode?
Asked
Active
Viewed 65 times
0
-
1Not clear if you are aware of/taken into account of: [Doze mode](https://developer.android.com/training/monitoring-device-state/doze-standby). Also depending on physical device, see: https://dontkillmyapp.com/ – Morrison Chang May 08 '22 at 20:41
-
Wasnt aware of it. Thsnk you @MorrisonChang – Andrei V May 08 '22 at 22:37
-
Is it possible to tell from code when device goes into Doze mode? – Andrei V May 09 '22 at 05:10
-
Related: [Detecting Doze State](https://stackoverflow.com/q/35143089/295004) but you may need to explain your use case (perhaps as a separate questions with code/documentation references) as my second link indicates that some OEM/ODM may use extreme battery saving measures, i.e. you can't tell if your app isn't even invoked/woken up. – Morrison Chang May 09 '22 at 18:16