In those code,
StringBuffer echo = new StringBuffer();
Process process = runtime.exec("ping -c 4 127.0.0.1");
InputStreamReader reader = new InputStreamReader(process.getInputStream
());
BufferedReader bufferedReader = new BufferedReader(reader);
String line = "";
while ((line = bufferedReader.readLine()) != null) {
echo.append(line+"\n\r");
}
str = echo.toString();

the str is "" after runing. But If I replace the "ping -c 4 127.0.0.1"
with "ls".I can get the str. I run "ping -c 4 127.0.0.1" in adb shell,
It surely return something. why I can't get return from the code?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to