Checks whether the device is connected to the internet or not. Then it displays toast accordingly.
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Checks whether the device is connected to the internet or not.
Java