Search code examples
androidnetwork-programmingandroid-wifi

what are possible arguments could be passed to getNetworkInfo()


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?


Solution

  • 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;