Can we turn the device on or off programmatically?

I know that there is a way to reboot the device. And this shows an immediate result.

But my need is this: -

I want that when I will be in my classroom, my phone will automatically turn OFF. (Say, at 2 p.m.), and when I finish my class, my phone will turn on automatically (say, at 17:00).

So, I'm looking for ways to automatically turn on / off the device.

Is it possible? If so, how can I do this?

+6
source share
3 answers
+3
source

Not. Once ot is turned off, it cannot be turned on. I think you need to completely turn off your phone, not turn it off.

+3
source

If you do not want your phone to receive calls and connect to any network, turning AirplaneMode on / off using AlarmManager (or Timer ) might be a better idea.

+2
source

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


All Articles