I\'ve been trying to retrive the current network type, but no success
when i say network type: i refer to know this info:
if the type is: NETWORK_TYPE_IDEN
I am using this function:
public String get_network()
{Activity act=(Activity)context;
String network_type="UNKNOWN";//maybe usb reverse tethering
NetworkInfo active_network=((ConnectivityManager)act.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
if (active_network!=null && active_network.isConnectedOrConnecting())
{if (active_network.getType()==ConnectivityManager.TYPE_WIFI)
{network_type="WIFI";
}
else if (active_network.getType()==ConnectivityManager.TYPE_MOBILE)
{network_type=((ConnectivityManager)act.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo().getSubtypeName();
}
}
return network_type;
}