0

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?

Remi
  • 1,289
  • 1
  • 18
  • 52
  • 1
    [XE4 Firemonkey on iOS prevent sleep mode](http://stackoverflow.com/questions/16526110/xe4-firemonkey-on-ios-prevent-sleep-mode) and [Delphi XE5 Android. How to use PowerManager.WakeLock?](http://stackoverflow.com/q/19021647/576719). – LU RD Nov 02 '15 at 10:19
  • @LURD, thanks I already found the solution for iOS. I was hoping for a universal solution though. – Remi Nov 02 '15 at 12:44
  • Can provide clues on how you accomplished this for iOS ? – Alain Thiffault Nov 04 '15 at 00:26
  • @lowrider you can try the link of LURD. I'm stil trying to find a universal solution for both Android and iOS. – Remi Nov 05 '15 at 08:34
  • @LURD if you post your comment as an answer I will accept it! I think there is no universal way to solve this. – Remi Nov 09 '15 at 10:56

1 Answers1

0

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.

Community
  • 1
  • 1
LU RD
  • 34,438
  • 5
  • 88
  • 296