Discussion: how to modify Android timeout sleep time

By default, if the Android system does not operate for more than n minutes, it will automatically close the screen and enter the sleep state. In fact, some projects require timeout without sleep. If only for a single application, we can set the state through power management. If you want to set the timeout of all applications, you can refer to the following methods:

Method 1: adjustment Code: settings. System. Putint (getcontentresolver(), Android. Provider. Settings. System. Screen_off_timeout, - 1); Permissions: < uses permission Android: name = "Android. Permission. Write_settings" / >

Method 2: adjust the database: these settings of Android are stored in the SQL database, that is, you can directly modify the database to prevent Android from sleeping. sqlite3 /data/data/com.android.providers.settings/databases/settings.db

Specific SQL: update system set value = '- 1' where name = 'screen_ off_ timeout' ;

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>