private String do_exec(String cmd) { String s = ""; try { Process p = Runtime.getRuntime().exec(cmd); BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); String line = null; while ((line = in.readLine()) != null) { s += line; } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } // text.setText(s); Toast.makeText(MainActivity.this, "S"+s, Toast.LENGTH_SHORT).show(); return cmd; }