On 18 August 2011 20:39, Luiz Carvalho <[email protected]> wrote: > Hello Guys > > I've got a problem. > I can't run ping on emulator, even rooted, only in my Galaxy 5. > > Using this procedure: > > proc = Runtime.getRuntime (). exec ("su"); > DataProc = new DataOutputStream > DataOutputStream (proc.getOutputStream ()); > dataProc.writeBytes ("exec ping www.google.com-c 2 \ n"); > > I get the response in the device, but in the emulator no have > answers. > > I need of the statistics generated by ping. > > Can anyone help me?
Is there some spacing issue in your command line: "-c 2" ? There is much better solution: use InetAddress.isreachable(). It does send the ICMP ECHO (i.e. ping). You can get your stats by timing this call (or multiple calls). -- Daniel Drozdzewski -- 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

