简体   繁体   English

如何防止Ionic使Android设备闲置?

[英]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.

相关问题 如何防止Android设备以编程方式进入睡眠状态? - How do I prevent an Android device from going to sleep programmatically? 如何防止 Android 设备从 Qt 应用程序进入睡眠状态 - How do I prevent an Android device from going to sleep from Qt application 如何防止手机进入空闲模式 - How to prevent phone from going to idle mode (Android)如何防止开发/测试过程中的崩溃进入Google Play崩溃报告? - (Android) How do I prevent crashes while developing/testing from going to google play crash reports? 如何防止android设备后退按钮在颤动中返回闪屏? - How to prevent android device back button from going back to splash screen in flutter? 如何防止 android 设备从 USB 共享屏幕? - How do i prevent android device from sharing screen from USB? 防止 Android chrome 闲置/自动锁定/休眠手机? - Prevent Android chrome from going idle / auto-locking / sleeping phone? 当设备水平放置时,如何防止android布局变为水平/横向 - How do i prevent my android layout from turning horizontal/landscape when the device is being held horizontally 在Android设备上,如何防止地址上的点击启动地图应用程序? - On an Android device, how do I prevent taps on an address from launching the Maps application? 如何阻止Android设备截取我的网页? - How do I prevent an Android device from a taking a screenshot of my webpage?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM