Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to take a screenshot of an android layout?

Tags:

android

my question is how do I take a screenshot using the built in screen capture. Any hints or sample code would be greatly appreciated.

like image 583
Nisha Avatar asked Dec 07 '22 15:12

Nisha


2 Answers

There are two ways you can try,

  • Using Eclipse

Open the Devices view in Eclipse ( Window Menu --> Show View Option --> Other, Android --> Devices), and there's a toolbar button on the right side labeled Screen Capture

  • Using Android Code

    Bitmap bitmap;
    View v1 = MyView.getRootView();
    v1.setDrawingCacheEnabled(true);
    bitmap = Bitmap.createBitmap(v1.getDrawingCache());
    v1.setDrawingCacheEnabled(false);
    
like image 75
Krish Avatar answered Dec 09 '22 03:12

Krish


Click on DDMS select emulator from left side and then click on Camera icon.. and then save into your pc..

like image 27
RajaReddy PolamReddy Avatar answered Dec 09 '22 03:12

RajaReddy PolamReddy