Ping Tool application for Android

device-2014-03-26-225039Sometimes you would like to detect if a remote host is reachable. On a PC you can run the ping command that uses ICMP packages to detect it, but of course, it’s not easy to use this tool on Android.

So I’ve just created a Ping application that can make your life easier. Compared to other android-based ping applications, this tool gives you a nice, human-readable format of the ping result. You can order the results by packet size, response time or TTL value. To order the list, just click on the underlined labels.

Also you can get a detailed result for every packet, by clicking on a line, the application will display the status of the current packet and the statistics information of the packets until the selected packet. So if you selected 100 packets to be sent, by clicking on the 50th packet you can see the packet loss, the min,avg,max response time from the beginning until this packet.

What’s more, you can export the full list in csv format, so you can process them later by Excel or other spreadsheet software and make a diagram for example about the response time vs the elapsed time.

You can download the application here: Ping Tool on Google Play

And here are a few screenshots about the application:





WiFi Speed Test for Android Live Demo

Well, I’ve just created a few demo animations to make easier the usage of my WiFi Speed Test application.

Here you can watch the animations, I hope they will be useful:

Online demo 1: Test the speed of the WiFi using two Android-based devices

Online demo 2: Test the speed of a Samba share

Online demo 3: Test the speed of the WiFi using a computer and a Android-based device

Android: UDP broadcast message is not received

Recently, I ran into an interesting trouble: I created an application that can send UDP broadcast messages and an Android application that can receive them.
As easy as pie I thought, then I realized that the broadcast message is received on a few devices but not received on other devices…
First of all, the message was sent to the correct broadcast address, and the android code was also fine:

try {
DatagramSocket brsocket = new DatagramSocket(port, InetAddress.getByName(""));

byte[] recvBuf = new byte[255];
DatagramPacket packet = new DatagramPacket(recvBuf, recvBuf.length);
try {
} catch (IOException ex) {
Log.d("D", String.format("No broadcast message: %s", ex.getMessage()));
Log.d("D", String.format("Message received from: %s", packet.getAddress().getHostAddress()));

Using my Asus tablet or Sony mobile phone it worked properly, the broadcast message was received. Using my HTC Desire, there was no broadcast message at all.

And what is the solution? You should create a MulticastLock before reading from the socket. I don’t know why it needs for a few type of devices and why not for others, but this solves the problem.

So here is what you should do:

WifiManager wifi;
wifi = (WifiManager) parentContext.getSystemService(Context.WIFI_SERVICE);
MulticastLock mLock = wifi.createMulticastLock("lock");
//the receive code listed above
// at the end of this code

And of course, don’t forget to add the proper permission to the manifest:

<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />