Code example for TelephonyManager

Methods: getNetworkOperator, getPhoneType

0
	} 
	 
	public static String getOperator() {
		String out = "";
		try { 
			if(tm.getPhoneType() != TelephonyManager.PHONE_TYPE_NONE)
				out = tm.getNetworkOperator();
			return out;
		} catch(NullPointerException e) {
			return ""; 
		} 
	} 
	 
	public static String getCellId() {	
		String out = "";
		try { 
			if (tm.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) {
				final GsmCellLocation gLoc = (GsmCellLocation) tm.getCellLocation();
				if(gLoc != null)
					out = Integer.toString(gLoc.getCid());
			}