Article sections

    In order to prevent the battery from draining, all Android devices will go to sleep mode quickly. However, in some cases, the application needs to activate the screen or CPU and keep it open to complete certain tasks or be a nice app for the user (think about recipe / cooking apps!). The approach you choose should therefore depend on the needs of the application. However, in general, it is recommended that you use the simplest method possible for your application to minimize its impact on system resources. In the following part, I describe how to handle cases where the device’s default sleep behavior is not compatible with your application requirements:

     

    Use WebViewGold for Android to easily set PREVENT_SLEEP to true (you find that configuration boolean in the Config.java file).

    in WebViewGold for Android