To make screenshots I use this code:
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();
os.close();
sh.waitFor();
But this is veeery slow! Maybe because phone is saving this image on storage. To get this bitmap I use this code:
bitmap = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory()+
File.separator +"img.png");
But that's pretty slow! Is possible to get bitmap but not save it? Maybe it will be much faster?