Screen

	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 "";
	}


你可能感兴趣的:(Screen)