Programatically turn off phone

rfresh

Well-Known Member
Licensed User
Longtime User
I've searched around and cannot find any information to programatically turn off my phone. Can someone please point me to any documentation or examples on how to do this? I don't want to root my phone in order to do this.

Thanks...
 

rfresh

Well-Known Member
Licensed User
Longtime User
Yes, I looked this page over pretty good but did not see any mention of being able to turn your phone off by code.
 
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User
If this is an app you are making for rooted devices, then this can be
done with a

su
reboot

commands...


Otherwise, non-rooted apps, this cannot be performed:

"Only system applications and applications signed with the same key that was used to sign the firmware will be able to get that permission."
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
Thank you. I do not want to root my phone, so I guess I'm out of luck :sign0148:
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
If this is an app you are making for rooted devices, then this can be
done with a

su
reboot

commands...


Otherwise, non-rooted apps, this cannot be performed:

"Only system applications and applications signed with the same key that was used to sign the firmware will be able to get that permission."

Is the same true for turning on a phone? Can we turn on a phone using code?
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
I was wondering if any services were still 'awake' even tho the phone is off?
 
Upvote 0

mjtaryan

Active Member
Licensed User
Longtime User
If this is an app you are making for rooted devices, then this can be
done with a

su
reboot

commands...


Otherwise, non-rooted apps, this cannot be performed:

"Only system applications and applications signed with the same key that was used to sign the firmware will be able to get that permission."

Isn't there a way in code to trigger the OS event as if the power button were pressed and held, thus causing the shutdown dialog to popup?
 
Upvote 0
Top