Reputation: 1005
I'm programming an Android application, and I would like to do so that it doesn't shut down the screen, ever.Pretty much like a car gps app that keeps the screen on.
Would someone know how to do this with phonegap ?
If its not possible in Javascript, is there an easy way to do it in Java but inside the main Phonegap function ?
Thank you
Upvotes: 7
Views: 2828
Reputation: 22493
use this property in the ManiFestFile
<uses-permission android:name="android.permission.WAKE_LOCK"/>
and add this in the required Activity
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Upvotes: 15