Android TelephonyManager - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android TelephonyManager class.

This code example shows how to use the following methods: getDeviceId
	} 
	 
	public String getUuid()
	{		 
		TelephonyManager operator = (TelephonyManager) mCtx.getSystemService(Context.TELEPHONY_SERVICE);
		String uuid = operator.getDeviceId();
		return uuid;
	} 
	 
	public void init() 
	{ 
		mAppView.loadUrl("javascript:Device.setData('Android','" + version + "','" + this.getUuid() + "')");
	} 
	 
	public String getModel()
	{ 
		String model = android.os.Build.MODEL;
		return model;
	} 
	public String getProductName()
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getNetworkCountryIso
        return carrierId;
    } 
 
    public static String getCountryCode(Context context) {
        TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        String countryCode = tm.getNetworkCountryIso();
        if (TextUtils.isEmpty(countryCode)) {
            countryCode = "Unknown";
        } 
        return countryCode;
    } 
 
    public static String getDevice() {
        return SystemProperties.get("ro.cm.device"); 
    } 
 
    public static String getModVersion() {
        return SystemProperties.get("ro.cm.version"); 
    } 
 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDeviceId, getLine1Number, getNetworkCountryIso, getNetworkOperatorName, getSimCountryIso
		ctx = c;
		tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
	} 
	 
	public String getPhoneNumber() {
		return tm.getLine1Number();
	} 
	 
	public String getIMEI() {
		return tm.getDeviceId();
	} 
	 
	public String getCountryCode() {
		return tm.getNetworkCountryIso();
	} 
	 
	public String getOperatorName() {
		return tm.getNetworkOperatorName();
	} 
	 

8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getPhoneType
	} 
	 
	public static boolean supportSMS(Context ctx){
		//Froyo or above!! 
		TelephonyManager telephonyManager1 = (TelephonyManager)ctx.getSystemService(Context.TELEPHONY_SERVICE);
        boolean isPhone = !(telephonyManager1.getPhoneType()==TelephonyManager.PHONE_TYPE_NONE);
        boolean featureTelephony = ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
		return isPhone && featureTelephony;
	} 
 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDeviceId, getSimSerialNumber
		if(deviceId == null){
		 
			TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
	 
		    String tmDevice, tmSerial, tmPhone, androidId;
		    tmDevice = "" + tm.getDeviceId();
		    tmSerial = "" + tm.getSimSerialNumber();
		    androidId = "" + android.provider.Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
	 
		    UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
		    deviceId = deviceUuid.toString();
		     
		    System.err.println(deviceId);
		} 
	    return deviceId;
	} 
	 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android TelephonyManager Questions & Answers:

See Code Examples for Android TelephonyManager Methods: