I am trying shut down and reboot in my app.
I googled and found some answered questions on stackoverflow but all says device must be rooted that is not possible in my case. also these commands are device specific.
Is there any option to shut down or reboot android device programaticaly
tried following things
String command="/system/bin/reboot";
try { // Run Script
proc = runtime.exec("su");
osw = new OutputStreamWriter(proc.getOutputStream());
osw.write(command);
osw.flush();
osw.close();
} catch (IOException ex) {}
and
Runtime.getRuntime().exec(new String[]{"su","-c","reboot now"});