Automatic turn on in android device

I want to develop an app whereby one of it functionality is power on the device when it be powered off. I searched in developer documents but I find anything related to it.

There is a way to set your device to automatic power on? like a scheduled task?

Upvotes: 0

Views: 384

Answers (2)

kichik
kichik

Reputation: 34704

This is possible on normal Linux machines with RTC wake alarm:

$ sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm" 
$ sudo sh -c "echo `date '+%s' -d '+ 3 minutes'` > /sys/class/rtc/rtc0/wakealarm"

I have never tried this on Android, and if it does work, I'd imagine it requires rooting your device. Maybe that'd be good enough for your use case.

As @CommonsWare mentioned, some manufactures seem to support this as a setting. I'm not sure if they have an API, but that might also be worth researching. One of them seems to be Samsung.

Upvotes: 1

CommonsWare
CommonsWare

Reputation: 1006944

There is nothing in the Android SDK itself for turning the device on from a fully-powered-off state. Some device manufacturers may have features for this, and some subset of those might have an API for it.

Upvotes: 1

Related Questions