I am trying to automate 'taking a screenshot' on Galaxy S4 and Kindle HDX 8.9 and I am using the following code.
if(!(getUiDevice().takeScreenshot(new File("ANYPATH"))))
System.out.println("False: Screenshot not taken!!");
else
System.out.println("Gangnam Style...");
ANYPATH values I tried:
- /data/local/tmp/ (For both devices) . Not sure where would I find this folder on the device, I tried this because I pushed my jars to this location.
- /sdcard/pictures/ (For Kindle HDX)
- /storage/emulated/0 (for Galaxy S4)
Irrespective of the path I try, the condition always returns false and the screenshot is not taken on any of the devices (actual devices and not an emulator). I am not sure what am I missing here?
I am just following the syntax from http://developer.android.com/tools/help/uiautomator/UiDevice.html#takeScreenshot(java.io.File)
Regards, Rumit