Android examples for Android OS:Shell Command
Execute chmod command
import java.io.IOException; public class Main { public static boolean chmod(String permission, String path) throws IOException, InterruptedException { String command = "chmod " + permission + " " + path; Runtime runtime = Runtime.getRuntime(); Process p = runtime.exec(command); int status = p.waitFor(); // chmod succeed // chmod failed return status == 0; }/* ww w . ja v a2 s . c o m*/ }