Dave's Brain

Browse - Programming Tips - How can I do a screenshot from java code?

Date: 2015may13
OS: Android
Keywords: screen capture
Language: java

Q.  How can I do a screenshot from java code?

A.  If you have root access:

String a [] = { "/system/bin/screencap", "-p", "/sdcard/screen.png" }; Runtime.getRuntime().exec(a);

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.