Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to run a linux command in an Android app
try {
String commandLine = "date";
Process process = Runtime.getRuntime().exec(commandLine);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String value = bufferedReader.readLine();
TextView dateTextView = (TextView) findViewById(;
} catch (IOException e) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment