Issue chmod command - Android Android OS

Android examples for Android OS:Shell Command

Description

Issue chmod command

Demo Code

import java.io.IOException;

public class Main {

  public static void chmod(String permission, String path) {
    try {//ww  w .  j a v a 2s.c  o  m
      String command = String.format("chmod %s %s", permission, path);
      Runtime runtime = Runtime.getRuntime();
      runtime.exec(command);
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

}

Related Tutorials