In my application I want to get the screenshot of my rooted device. I am using the following code to achieve this:
Process sh = Runtime.getRuntime().exec("su", null,null);
OutputStream os = sh.getOutputStream();
os.write(("/system/bin/screencap -p " + "/sdcard/img.png").getBytes("ASCII"));
os.flush();
But I am not getting any image stored.