Monday, March 11, 2013

How to find the mobile network details in android

 TelephonyManager tel = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

// Type of the network
int phoneTypeInt = tel.getPhoneType();
String phoneType = null;
phoneType = phoneTypeInt == TelephonyManager.PHONE_TYPE_GSM ? "gsm" : phoneType;
phoneType = phoneTypeInt == TelephonyManager.PHONE_TYPE_CDMA ? "cdma" : phoneType;
try {
if (phoneType != null) {
params.put("radioType", phoneType);
  } } catch (Exception e) {}