title: How to take screen-shot of app screen in android?
body: <p>I am developing an application in which I have to take screen-shot of app screen
  right now I used below code it is not working. I am null bitmap image</p>
  
  <pre><code>Process sh = Runtime.getRuntime().exec("su", null,null);
  OutputStream  os = sh.getOutputStream();
  os.write(("/system/bin/screencap -p " + "/sdcard/"+ "bs_score_img" +".png").getBytes("ASCII"));
  os.flush();
  os.close();
  sh.waitFor();
  
  String screenShot =  Environment.getExternalStorageDirectory().toString()+"/bs_score_img.png";
  Log.i("TAG:Score: screenShot path=", screenShot);
  Bitmap bmp = BitmapFactory.decodeFile(new File(screenShot).getAbsolutePath());
  </code></pre>