cife
cife

Reputation: 21

Is there anyway to reboot a device programmatically without root?

I want to reboot my phone using my app,but it requires root .

is there anyway to do it without root ?

My Code :

 try {
        Runtime.getRuntime().exec(new String[]{"su","-c","reboot now"});
    } catch (IOException e) {
        e.printStackTrace();
    }

Edit : i've heard that we can reboot phone without root using
'devicepolicymanager' . but i can't understand the official documentation 🙁 , if anyone knows it please leave a demo code.

Upvotes: 1

Views: 942

Answers (1)

McSlinPlay
McSlinPlay

Reputation: 549

As far as I know you need root privileges to achieve this behavior.

Upvotes: 1

Related Questions