GPRS/3G/Wifi connections can timeout easily on Android and it leads to missed Gmail/Whatsapp and other App notifications, Mostly this happens with GPRS connections not to forget that ‘sometimes’ irritating Wifi connection that gets disconnected during downloads and stuff.
On an Android phone its pretty easy to fix this problem, A wireless connection gets disconnected when there is no activity in the network so the simple solution to this would be to produce activity in the network connection.
How to do that?
Again simple, A simple Ping is all it takes to keep a connection alive
What is a Ping?
This is how Wikipedia defines a Ping:
Ping is a computer network administration utility used to test the reachability of a host on an Internet Protocol (IP) network and to measure the round-trip time for messages sent from the originating host to a destination computer. The name comes from active sonar terminology which sends a pulse of sound and listens for the echo to detect objects underwater.
In simple words a Ping is a command used to send a small packet of data to a remote host in order to check the network for errors and timeouts.
Sending a Ping keeps the connection alive.
Want to test ping?
Open Command Prompt (Ctrl+R > cmd). Type in “ping www.hacktabs.com” type this in Command Prompt without the quotes. This will hopefully send a series of 32 Bytes packets to this site. You will see that this sends 4 batch of those packets. To keep this pinging for an infinite amount of time, Use this command : “ping www.hacktabs.com -t” where “-t” is the traceroute command.
To get the whole list of operators to use with Ping command, Type in “ping” in the command prompt window for Help.
Now using this same command on Android we can keep our wireless connection alive. To perform Ping we need a terminal on the Android so follow these steps.
Keeping Android’s Wireless Connection Alive.
Step 1. Head over to Google Play Store and Search for ‘Terminal Emulator‘ app.
Step 2. Download it and install on your device.
Step 3. Open up the installed app.
Step 4. Type in “ping www.google.com” to start the ping.
Step 5. Press Home button and the Terminal Emulator will run in the background until you decide to stop it manually.
Do this only if you have Unlimited Data Usage plan as the small bits and bytes adds up to quite some amount if you are on a limited plan. Also don’t move this app to the SD Card as it will deter it from running in the background correctly.
Hope this helps you, Do share this on Social Networks if you think this will benefit others.