Android : How to take screenshoot or screen capture on android without root?

on Friday, July 25, 2014


How to take screenshoot or screen capture on android without root ? 1. i have try this code :



public void saveBitmap(Bitmap bitmap) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss");
String currentDateandTime = sdf.format(new Date());

sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));
File imagePath = new File(Environment.getExternalStorageDirectory() + currentDateandTime);
FileOutputStream fos;
try {
fos = new FileOutputStream(imagePath);
bitmap.compress(CompressFormat.PNG, 100, fos);
fos.flush();
fos.close();
} catch (FileNotFoundException e) {
Log.e("GREC", e.getMessage(), e);
} catch (IOException e) {
Log.e("GREC", e.getMessage(), e);
}
}


but it's not working when i execute and i know thats because my phone not root. how to take screenshoot without root?


0 comments:

Post a Comment