1

I have checked the suggested question here, but when I checked the documentation regarding the method getNetworkInfo()here, there was no documentation regarding the possible integer values this method could handle. For an example, if I passed 0 to the getNetworkInfo() this means I am checking he mobile network, and if it is 1, I am checking the status of the WiFi.

Is there any other possible values? Why they are not in the documentation?

Cœur
  • 34,719
  • 24
  • 185
  • 251
user2121
  • 7,091
  • 17
  • 63
  • 138
  • 2
    possible duplicate of [Android: How to Enable/Disable Wifi or Internet Connection Programmatically](http://stackoverflow.com/questions/3930990/android-how-to-enable-disable-wifi-or-internet-connection-programmatically) – Pedro Oliveira Nov 06 '14 at 17:23
  • @PedroOliveira kindly please see the update – user2121 Nov 06 '14 at 18:25

1 Answers1

2

From the docs: http://developer.android.com/reference/android/net/ConnectivityManager.html

public static final int TYPE_NONE        = -1;

public static final int TYPE_MOBILE      = 0;

public static final int TYPE_WIFI        = 1;

public static final int TYPE_MOBILE_MMS  = 2;

public static final int TYPE_MOBILE_SUPL = 3;

public static final int TYPE_MOBILE_DUN  = 4;

public static final int TYPE_MOBILE_HIPRI = 5;

public static final int TYPE_WIMAX       = 6;

public static final int TYPE_BLUETOOTH   = 7;

public static final int TYPE_DUMMY       = 8;

public static final int TYPE_ETHERNET    = 9;

public static final int TYPE_MOBILE_FOTA = 10;

public static final int TYPE_MOBILE_IMS  = 11;

public static final int TYPE_MOBILE_CBS  = 12;

public static final int TYPE_WIFI_P2P    = 13;

public static final int TYPE_MOBILE_IA = 14;
Pedro Oliveira
  • 20,371
  • 8
  • 53
  • 82
  • oh thank you, i have checked the link but i did not find the numbers (-1 to 14) assigned to each type? where di you get them – user2121 Nov 06 '14 at 21:34
  • hi, i marked your answer as a correct answer because I have checeked it, but till now i did not find that list o integer values passed to the method. kindly woud you please give me the exact lin where i can find thoses integers? – user2121 Nov 07 '14 at 09:14
  • 1
    `sdk\sources\android-21\android\net\ConnectivityManager.java` or http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.4_r1/android/net/ConnectivityManager.java#ConnectivityManager – Pedro Oliveira Nov 07 '14 at 09:16