Screen capture on the root device I want to capture the screen of an Android device embedded using the APK. I tried
process = Runtime.getRuntime().exec("/system/bin/screencap -p " + path + "/file.png ");
This command works fine, but it is too slow. Then I tried to use the second option
View content = findViewById(android.R.id.content).getRootView(); content.setDrawingCacheEnabled(true); Bitmap bitmap = Bitmap.createBitmap(content.getDrawingCache()); OutputStream fout = null; File imageFile = new File(_path,"ScreenImage.png"); try { fout = new FileOutputStream(imageFile); bitmap.compress(Bitmap.CompressFormat.JPEG, 90, fout); fout.flush(); fout.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }
But in this I get the idea that my application is not the current screen. I have to capture screenshots to make videos of them. I use FB0 to create a video, but the problem is screen capture at 8 frames per second.
Please suggest a solution to expedite this process. resolution is not a problem; it may be of poor quality.
source share