title: Android screen capture on rooted device
body: <p>Screen capture on rooted device
  I want to capture screen of an android device rooted using APK.
  I tried </p>
  
  <pre><code>process = Runtime.getRuntime().exec("/system/bin/screencap -p " + path + ”/file.png ”);
  </code></pre>
  
  <p>This command is working fine but it is too slow.
  Then I tried using second option</p>
  
  <pre><code>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();
  }
  </code></pre>
  
  <p>But in this I am getting view of my application not current screen.
  I am is to capture screen shots an make video out of them I am using FB0 to make video but make problem is to capture screen with speed of 8 frames per second</p>
  
  <p>Please suggest solution for speeding this process. resolution is not problem it can be of poor quality.</p>