public static String screenCap(String url) {
Process sh;
try {
sh = Runtime.getRuntime().exec("su", null, null);
OutputStream os = sh.getOutputStream();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
String str = df.format(new Date());
os.write(("/system/bin/screencap -p " + url + "/Allscreen" + str + ".png").getBytes());
os.flush();
os.close();
sh.waitFor();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "";
}
还没有评论,来说两句吧...