Code example for TelephonyManager

Methods: getNetworkOperatorNamegetPhoneType

0
 
		TelephonyManager manager = (TelephonyManager) context
				.getSystemService(Context.TELEPHONY_SERVICE);
		 
		if (manager != null) {
			telephony.put("carrier",  manager.getNetworkOperatorName());
			 
			telephony.put("radio", getRadio(manager));
		} 
		 
		return telephony;
	} 
	 
	private String getRadio(TelephonyManager manager) {
		switch(manager.getPhoneType()) {
	        case 0x00000000:  
	            return "none"; 
	        case 0x00000001: 
	            return "gsm"; 
	        case 0x00000002: 
Stop searching for code, let great code find you!  Add Codota to your java IDE