Android How to check network status(Both Wifi and Mobile 3G)

There is always a need for a developer to check the network status of the network connected to the phone. Here are some example code to check the network status .

You need the following permission to get status

[sourcecode language="xml"]
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>

Syndicate content