0

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.

DisplayName
  • 3,093
  • 5
  • 35
  • 42
sunil
  • 71
  • 1
  • 3

0 Answers0