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
//**Return type of connection to network
public static int getNetworkType(Context context) {
if (!isNetworkConnected(context))
return -1;
ConnectivityManager conMan = (ConnectivityManager) context.
getSystemService(Context.CONNECTIVITY_SERVICE);
//mobile
State mobile = conMan.getNetworkInfo(0).getState();
//wifi
State wifi = conMan.getNetworkInfo(1).getState();
int result = 0;
if (mobile == State.CONNECTED || mobile == State.CONNECTING) {
result |= NETWORK_MOBILE;
}
if (wifi == State.CONNECTED || wifi == State.CONNECTING) {
result |= NETWORK_WIFI;
}
return result;
}