cubesoft
cubesoft

Reputation: 3550

android - capture of the entire screen programatically

Is it possible to capture the entire screen from Android application code? I'm developing an application like VNC for Android platform.

Regards

Upvotes: 1

Views: 3753

Answers (3)

Kjartan
Kjartan

Reputation: 19081

I think that depends on what you are trying to capture. I'm sure you can use Moss's method to create a screenshot from your own application - that is, something you render yourself.

As I understand it however, capturing from other views, apps, etc. is designed to be impossible for security reasons. This is to avoid apps being able to take screen shots from other apps, which would make it easy to steal sensitive data.

Upvotes: 2

Joel Martinez
Joel Martinez

Reputation: 47751

I don't have personal experience with it, but this open source project sounds like it might either solve your problem, or provide you clues as to which API to use:
http://sourceforge.net/projects/ashot/

Screen capturing tool for Android handsets connected via USB to a desktop/laptop. It is great for fullscreen presentations, product demos, automatic screen recording, or just a single screenshot. Without root.

Upvotes: 0

Moss
Moss

Reputation: 6012

yes it is. You just need to create a canvas and assign it a Bitmap, then draw to that canvas instead of the canvas you use in your onDraw method and save the bitmap on the SDcard for example.

Just to renind you that this method will work if you handle the drawing, so you should use a custom home screen for it to capture wether you want. (just get the default android home screen :D).

Upvotes: 1

Related Questions