[英]How do I prevent and Android device from going idle in Ionic?
So I'm developing an Ionic application and I'm mostly targeting Android tablets. 因此,我正在开发Ionic应用程序,并且主要针对Android平板电脑。
How can I proceed to prevent the device from going idle when the app is launched? 启动应用程序后,如何继续防止设备进入空闲状态? I want the screen to stay bright forever until the user possibly decides to close the app.
我希望屏幕永远保持明亮,直到用户可能决定关闭该应用程序为止。
You will need to use a corova plugin for this. 您将需要为此使用corova插件。
There is a plugin that 'may' help: https://github.com/Viras-/cordova-plugin-powermanagement 有一个“可能”有帮助的插件: https : //github.com/Viras-/cordova-plugin-powermanagement
Also have a look at the Android Powermanagement API and eventually use the source code of the plugin as a starting point to make the required changes. 还可以查看Android Powermanagement API,并最终使用插件的源代码作为进行所需更改的起点。
http://developer.android.com/reference/android/os/PowerManager.html http://developer.android.com/reference/android/os/PowerManager.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.