File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Android and the fly likes How to capture the current screen from device Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "How to capture the current screen from device" Watch "How to capture the current screen from device" New topic

How to capture the current screen from device

Vaishu Mol

Joined: Jan 21, 2010
Posts: 5
Hi friends,
Here is my xml coding.

Im displaying image and text on device. And i would like to capture the screen on my device and would like to send email the image+text.
How to capture the screen with image and text?
Please help me friends.
Thanks in advance.
Monu Tripathi

Joined: Oct 12, 2008
Posts: 1369

You can use the view.draw(canvas) method to make the view draw whatever it is displaying, onto a canvas.
Create an empty bitmap, set it on a new canvas and pass this canvas to a view. In your case this, "view" will have to be the root view(the FrameLayout, I think).

See if the following threads can help:
capturing image on canvas
taking a screen shot of whatever is drawn on the view

Hope that helps...

[List of FAQs] | [Android FAQ] | [Samuh Varta]
Bill Mote
Ranch Hand

Joined: Feb 04, 2010
Posts: 44
You can capture the screen output on your PC by enabling USB debugging. Instructions here: Android Development


With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: How to capture the current screen from device
Similar Threads
odd framelayout/surfaceview problem
Layout issue-footer image to the bottom of screen (Landscape & portrai) irrespective of body content
ListView Problem
TabHost repeating tab content
Layouts, bottom position