Sometimes, while browsing or playing on your mobile, you may have detected that the content you want to access does not load well. Even the game, if it is online, may not respond to your orders. These two situations indicate that you probably have a connection problem, which you will need to verify. As with desktop computers, the way to do it in Android is to use the ping command, only this instruction works exclusively in command-line environments and not in a graphical environment. Android does not have a terminal natively, can it be done the same? Yes, and also in an alternative way.
Pinging from a terminal emulator
The first way to ping from Android is to use a terminal emulator. Android Terminal Emulator is one of the most popular, and it is the one that we are going to recommend using. It is worth noting that if we ask the app to ping without further ado, it will do so indefinitely, so we will have to introduce a modifier that we will give you later so that it only performs a specific number.
- To use this application we will first have to download and install it.
- Notice that we add the -c modifier and a number to the instruction. With it we imply that we want the operation to be performed only that specific number of times, not one more time.
- Analyzing the results, that response is received and latency times are less than 100 milliseconds is a good sign. Otherwise, we could have a connection problem.
- Next, use the ping command with the gateway to check that there is a connection between the phone and the router. For this we will have to use the following command first:
- With it, we can find out what exactly our gateway is, here represented as Broadcast and generally with the address 192.168.1.255. To ping this address we will have to enter this command with the -b switch, which refers to the Broadcast:
ping -b -c 4 192.168.1.255
- If we get a response with communication, in reasonably short times and with packet transmission, the next thing is to ping a web. For this we enter the following command:
- If everything works correctly the result should be what we have described so far.