I wanted to run some shell commands through a java program for android. The app just takes in a command executes it on the shell and returns the result.
I used this :
Process p=Runtime.getRuntime().exec(in); p.waitFor();
BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream()));
String line=reader.readLine();
output = line;
while(line!=null) {
output = output +"\n"+ line; //System.out.println(line);line=reader.readLine();
}
"in" is the input from a text box.
1> I observed that most of the commands that come as a part of android work for the above statement. But i installed busybox to get other linux commands too. But none of these commands are running. Every time it just returns a NULL result. I Installed busybox both into /system/xbin as well as /system/bin (after remounting the /system partition as read/write)
2> Secondly if I do ls on a particular location like ls /sdcard, it takes /sdcard as the command. But ls -l works (just in case you feel the whitespace is causing a problem)
Please help me out
inwith a working command? What is the content of some busybox that does not work? Do you have some logcat of a non working exec?