I am trying to take screenshot an a rooted android phone locally. I want to take screenshot of other activites, via a service. The only requirement is that the screenshot should be atmost ~ 100ms.
I try
java.lang.Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
os.writeBytes("cat /dev/graphics/fb0 > " + raw + "\n");
os.writeBytes("exit\n");
os.flush();
os.close();
process.waitFor();
but as i try to write it to a file, it takes a bit too long!
Also, as I am trying to do this locally on the phone, without connecting it to the PC.