w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to convert .raw file to image file in android rooted device programmatically

if raw is image file then u can change extentention to jpg or png,

File ss = new File(ssDir, "ss.raw");

change this to

   File ss = new File(ssDir, "ss.jpg");

but capturing screenshots require root permission to execute su permission

 File f = new
Process localProcess  = Runtime.getRuntime().exec("su");
OutputStream  os = localProcess .getOutputStream();
 //DataOutputStream  dos = (DataOutputStream)
os.write(("/system/bin/screencap -p " + f.toString()).getBytes("ASCII"));
localProcess .waitFor();

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.