简体   繁体   中英

How can I prevent apps from going into sleep mode in Delphi XE8

I have a multi device Firemonkey project in Delphi XE8 which I use to make iOS and Android apps. If I am running my apps on the devices they sometimes go to sleep if I didn't touch the screen but the app is still loading stuff.

So how can I stop the app from going into sleep mode for both Android and iOS?

There is currently no universal way to prevent a mobile FireMonkey application from going to sleep when user activity is too low.

For iOS there is one proposed solution here: XE4 Firemonkey on iOS prevent sleep mode and for Android is another one: Delphi XE5 Android. How to use PowerManager.WakeLock? .

They are using different API calls and methods, so it would be difficult to share the same code. You could wrap the functionality into a library and with some ifdef's perhaps invoke it the same way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM