Android Question service.startforground and Phonesensors

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,

May I ask the help of the community about an odd behaviour I have with somes devices, please.

I have an app which looks at the user's moves. For that, I start a service forground which initializes the phonesensor. In the same time I start some timers and do some other tasks.

This service is never killed and the timers and other tasks are always executed BUT when the device's screen is OFF the sensor doesn't send any information.

I have already tried several ways like for example becoming Administrator or use partial lock with PhoneWakeState but without any success. Before to let this done I would like to ask you if you have any idea about a possible fix.

Many thanks
 
Last edited:

lemonisdead

Well-Known Member
Licensed User
Longtime User
Thank you very much Erel for sharing with us. It is the right solution and fixed the problem.
 
Upvote 0
Top