Screenshot capture without Root permission in Android
/*** The returned bitmap is the screen content */private static Bitmap takeScreenShot (Activity activity) {View view = activity. getWindow (). getDecorView (); // Enables or disables the drawing cacheview. setDrawingCacheEnabled (true); // will draw the view in a bitmapview. buildDrawingCache (); Bitmap bitmap = view. getDrawingCache (); Rect frame = new Rect (); activity. getWindow (). getDecorView (). getWindowVisibleDisplayFrame (frame); int statusBarHeight = frame. top; int width = activity. getWindowManager (). getdefadisplay display (). getWidth (); int height = activity. getWindowManager (). getdefadisplay display (). getHeight (); // remove the title bar Bitmap B = Bitmap. createBitmap (bitmap, 0, statusBarHeight, width, height-statusBarHeight); view. destroyDrawingCache (); return B ;}