Lockscreen Problem

BlueVision

Active Member
Licensed User
Longtime User
Programming my first app and fighting now with an android-typical problem. Read already many posts in the forum but could not find a way for solving my problem.
Imagine, an android-based waycounter, based on GPS. Works great compared with my GPS in the car so far.

But:

There comes a time when the lockscreen of my android fires. At this moment my app is freezing and continuing when I unlock the android. So this is a kind of "amnesia" during lockscreen. Because of the nature of the app, all my values getting restored and the app continues. So far so good. But continuing the app makes no sense, the values are wrong because of the missing data during lockscreen.

Is there a way to implement a wakelock (dimmed display or black because of energy-issues (!), but the app should continue it's run and not sleep) or to temporary remove the lockscreen when running the program and restoring to it's original value when the program ends? Think this is not primary a question about putting the variables into the right sub (Process Globals & Globals) because the app is continouing without dataloss after "rebirth", for me it looks somehow more like dealing with the lockscreen-event.

Any ideas?

Sorry if this got answered before, but after 2 hours searching in the forum I decided to ask my first question here. A newbie-question for sure I think.

Greetings from Berlin to all of you.

BTW: Great platform, I am really impressed. thousands of possibilities!

BV
 

BlueVision

Active Member
Licensed User
Longtime User
Take a look at PhoneWakeState (you need to reference the Phone library).

:sign0098:
Wonderful, it works now. This will have for sure some bad effects on batteryconsumption, but there is no other way. Unfortunately, the display is only dimmable, no way to switch it off. But better than nothing and for the most people it could be interesting to watch the changes on the display I think.

Thanks again for your help!
 
Upvote 0
Top