The standard way to do Ping in Android is using isReachable().
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!
I have used HttpGet a lot in Android, but today, I started to build my first android widget. I used HttpGet for accessing some external feeds. I got UnknownHostException. I have placed in the use-permission tag in AndroidManifest.xml
Well, I found that is because I placed this tag under manifest element. I should place it under the receiver element
Finally the problem is solved.
I have tried to get a string resource via getResources().getString(R.string.msg_err). Under values/strings.xml. I am 100% sure there is msg_err value. But I still got Resource$NotFoundException. But after I added msg_err1 value in text view mode, that works. I found the problem it cannot get the value if you create key value pair in "Resources" Tab in the string.xml. That is very strange!
DhcpInfo.dns1 and DhcpInfo.dns2 is an integer, not a readable IP string,"x.x.x.x". That is hard to understand. I did a search in internet. There are a number of people to write their own function to do that. Actually, Android SDK has a formatter to do that.
I found the jQuery validation is very good! Moreover, that is very easy to customize the error message. You just need to put the message in the "title" attribute.