Post the logcat when execute this command.
Just the code will not help.

Take a look at this code:

http://forum.sdx-developers.com/android-2-1-development/%28source%29-android-app-development-shellcommand-java-class/

May it help you.

Regards,

Rogerio

2010/8/24 NGUYEN Cong Kinh <[email protected]>

> Hi everyone,
>
> I am writing some code to execute the command ping from Android to a host
> as the following:
>
>         Runtime runtime = Runtime.getRuntime();
>         Process proc = runtime.exec("ping -c 1   " + hostname);
>         proc.waitFor();
>
> I see that the code works well on Android 1.5, but doesn't work on Android
> 2.0 both real device and emulator. Could any one give me an explanation
> about it or how to do so that I can execute the command ping?
>
>
> Thanks in advance,
> Kinh
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to