I am developing an app which is able to take screen shots and I found the following code which allows me to do that
Toast.makeText(this, formattedDate, Toas
in some cases having a ":" character in the filename is not allowed. You might want to replace it with "." or "-".
EDIT:
Try this:
os.write(("/system/bin/screencap -p " + "\"/sdcard/"+formattedDate+".png\"").getBytes("ASCII"));