Is it possible to shut down the whole phone by an app? How? Do I need to root the phone?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need the DEVICE_POWER permission in order to shut the phone completely off which requires the device being rooted.
You can use the PowerManager to get it to sleep or reboot.
http://developer.android.com/reference/android/os/PowerManager.html#reboot(java.lang.String)
Reboot also requires a permission:
http://developer.android.com/reference/android/Manifest.permission.html#REBOOT