The number of times I have to turn the cell phone screen on and off by pressing the power button is countless. I say turn off, because leaving the screen on unnecessarily will generate a not so negligible battery drain . From so much use of that particular button, it is not surprising that it ends up being damaged over the years..
Gravity Screen On Off is probably the best application for Android that exists to control the turning on and off of the cell phone screen, without touching any button . It is tremendously useful because the app alone takes care of turning off the screen when you are no longer using or leaving the phone lying around, or when you put it in your pocket. In the same way, it automatically turns on the screen when you pick up the cell phone to do something.
In short, it is an application that can turn the cell phone screen on and off automatically and intelligently, depending on what it does or does not do. As it does? It uses the proximity and gravity sensors (accelerometer) of the phone to detect if the mobile is upside down (in the pocket), is face down or face up (at rest on a table, for example) or even if it is in motion, and turns the screen on or off according to each situation..
Gravity Screen Settings.
How to use Gravity Screen
The application is in Spanish and is full of parameters that can be varied and activated. All are clearly explained (if you have questions, put them in the comments). You don't have to read, activate or vary the parameters if you don't want to, because Gravity Screen comes preconfigured to work almost well in most common positions where the cell phone is..
What is important to use is to activate it as "Android Device Manager" when starting it. This is commonly done from Settings> Security> Device Manager, but the application provides a button to go directly there and enable the box corresponding to "Gravity Screen". To uninstall the app it is necessary to previously deactivate that box, or use the uninstall option available in the app itself.
Additionally, it is necessary to verify that, in the upper part of the application, the enable button says «On». When the application is active, the application icon appears and remains in the status bar (apparently it is not possible to remove this icon).
Additional data
This app slightly increases battery consumption. It could consume around 7% depending on the developer (I assume that is the minimum value). The default settings should be consumer friendly. Varying some of them (for example, telling you to turn off the screen when the cell phone is face up) can further increase this consumption.
On the other hand, the PRO or Premium version of Gravity Screen claims to have better performance, an option to exclude the operation in certain applications, suspension of the app when the phone is in landscape mode, among other things. However, when trying the free version of the Play Store, the option to exclude applications has worked without problem.
One of the most common reasons why this application and other similar ones does not work well, is because the system battery saver has not been deactivated for it. For example, if the app stops working after a while, when the screen has turned off and the app does not turn it on automatically when you pick up the phone, etc. This can happen on any device, including Xiaomi, Huawei, or Samsung. To disable the battery saving of this app you have detailed instructions on the web in English dontkillmyapp.com
Conclution
This application automatically turns on my cell phone screen when I grab it from the table to do something, it turns it off when I put it there again, when I put it in my pocket, among other situations. It will get you a bit giddy sometimes, but generally speaking it works pretty well. Unfortunately it doesn't help to control the screen lock .
More information from the developer : XDA-Developers
Download Gravity Screen: Google Play Store
APPS to turn off the screen automatically or with a virtual button
How to turn on the screen by passing your hand over it (Samsung «Air Gestures»)
How to increase screen time on WITHOUT apps