execute shell command - Android Android OS

Android examples for Android OS:Shell Command

Description

execute shell command

Demo Code

import java.io.IOException;

import android.util.Log;

public class Main {

  private static final String TAG = "";

  public static void execute(String command) {
    try {/*  w w w. ja  va 2s  .  c o  m*/
      Runtime.getRuntime().exec(command);
    } catch (IOException e) {
      Log.i(TAG, e.getLocalizedMessage());
    }
  }

}

Related Tutorials