Ping won't work for external network in Android
The standard way to do Ping in Android is using isReachable().
Like this:
Code
InetAddress address = InetAddress.getByName("192.168.1.1")); | |
if(address.isReachable(100000)){ | |
// Success} |
But I tested this only working in local network and total not working in emulator too!
I guess for external IP address, it will only work on rooted phones.
Moreover, I am thinking whether Mobile Provider will block ICMP Package too!
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 71 feedbacks awaiting moderation...
Form is loading...