tags:

views:

65

answers:

1

how to check any kind of network status in android... please give me code for this.. thnx...

A: 
if (Context.getSystemService(Context.CONNECTIVITY_SERVICE).getNetworkInfo(
        ConnectivityManager.TYPE_MOBILE)
    || Context.getSystemService(Context.CONNECTIVITY_SERVICE).getNetworkInfo(
        ConnectivityManager.TYPE_WIFI) {

    // do something
}
Mentalikryst
thnx for the code
Sudipta for Android
+1, but obtain the "active" network from the connectivity service.
mrrtnn