Disable Android phone / tablet screen timeout

I want to completely disable the screen timeout. You can set anti-sleep in your application code, but it will not disable the automatic sleep mode of Android, which you can install from 15 seconds to 30 minutes, and the programs that I downloaded from the market cannot disable the sleep time limit for 30 minutes.

I want to run the AJAX web page in a browser, which should be constantly visible, connected to it, so power is not a problem.

+4
source share
3 answers

There is an XML method that Google recommends:

<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:keepScreenOn="true"> 

Tick http://www.google.com/events/io/2009/sessions/CodingLifeBatteryLife.html slide 16.

or

 getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 
+16
source

Take a look at this * (warning * link to an expensive course) Also this (free google tutorial - use this link).

Hope this helps.

+4
source

Go to about the tablet or phone in the settings of your device, go to the build number, quickly press the build number 7 times to enable the developer options, click the "Back" button, open the developer options, click "do not sleep", and now you're done; your screen will never sleep. Be smart and do not play in the options of the developer, you can very easily destroy your device.

0
source

Source: https://habr.com/ru/post/1334743/


All Articles