Posts

Showing posts with the label screenshot

HOW TO TAKE SCREENSHOT ON MOST OF THE SAMSUNG PHONES

Press Power & Home buttons at the same time will take the screenshot of the current screen. It’s important to to press both buttons at the same time , and hold them until the shutter sound is heard. ( press Power button slightly before pressing the Home button , then hold them both down.)

How to programmatically take a screenshot on Android?

First of All you need to add  WRITE_EXTERNAL_STORAGE permission in your Android manifest since will be writing to the external storage. To write to the external storage, we must request the  WRITE_EXTERNAL_STORAGE  permission in your  manifest file .     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" > Bitmap bitmap; //Create a bitmap object /*  android.graphics.Bitmap -  http://developer.android.com/reference/android/graphics/Bitmap.html */   View scrView = findViewById(R.id.root);    // Select the view   scrView.setDrawingCacheEnabled(true);    bitmap = Bitmap.createBitmap( scrView .getDrawingCache());  // returns an immutable bitmap from source bitmap    scrView .setDrawingCacheEnabled(false);   ByteArrayOutputStream bytes = new ByteArrayOutputStream(); //  http://developer.android.com/reference/java/io/ByteArrayOutputStream.html ...