How to Take Emulator Screenshots Using Eclipse

How to take emulator screenshots using Eclipse?

You can take a screenshot if you open the Android view "devices" (under Window --> Show View --> Other... --> Android --> Devices). Click on the device or emulator you want to take a screen shot of, then click the "Screen Capture" button (it looks like a little picture, and it should be next to a stop sign button). Occasionally the device won't immediately load the picture; sometimes you have to close/reopen the screen capture window.

This is equivalent to taking a picture via DDMS, but you can do it in Eclipse instead of opening another application.

Eclipse and Automatic Screenshots

Is there any feature in eclipse that will automatically take
screenshots of every screen while the app is running?

Yes, You can take a screenshot if you

open the Android view "devices" (under Window --> Show View -->
Other... --> Android --> Devices). Click on the device or emulator
you want to take a screen shot of, then click the "Screen Capture"
button (it looks like a little picture, and it should be next to a
stop sign button). Occasionally the device won't immediately load the
picture; sometimes you have to close/reopen the screen capture window.

This is equivalent to taking a picture via DDMS, but you can do it in Eclipse instead of opening another application.

does this need to be done programatically?

Yes, you can also do it like it as Below Code Suggests.

// image naming and path  to include sd card  appending name you choose for file
String mPath = Environment.getExternalStorageDirectory().toString() + "/" + ACCUWX.IMAGE_APPEND;

// create bitmap screen capture
Bitmap bitmap;
View v1 = mCurrentUrlMask.getRootView();
v1.setDrawingCacheEnabled(true);
bitmap = Bitmap.createBitmap(v1.getDrawingCache());
v1.setDrawingCacheEnabled(false);

OutputStream fout = null;
imageFile = new File(mPath);

try {
fout = new FileOutputStream(imageFile);
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, fout);
fout.flush();
fout.close();

} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

Then, when you need to access use something like this:

Uri uri = Uri.fromFile(new File(mPath));

How to take a good quality screenshot on emulator?

According to this answer that is an emulator issue. To solve this, you need to enable the 'use host GPU' setting when creating an emulator, according to another answer.

Capture screenshot in GenyMotion

Disclaimer : I'm part of the same company as the Genymotion team.

This feature is included in the product. It is one of the paid feature of the screencast widget. Look at the pricing page here.

Two ways to access it:

  • pay for the pro or indie licence
  • use the trial version, it offers you the indie features. Be careful, there is only one trial day left :-/

Once your VM is started, open the screencast widget

Sample Image

Then take a picture with the dedicated button

Sample Image

UPDATE: You have bellow another ways to take a screenshot using Android Device Monitor or the command line

Why can't I take screenshots in Android Emulator after installing Genymotion?

It's a known bug on 4.3 images, they are working on a fix. On a 4.2.2 image it's working for me, you can try to create a 4.2.2 device to take screenshot in the meantime.

Source: On twitter @genymotion responded to @Littledot1230 on this question :)



Related Topics



Leave a reply



Submit