Code example for TelephonyManager

Methods: getDeviceId

0
	 
	 
    protected static String getImei(Context context) {
        TelephonyManager m = (TelephonyManager) context
                .getSystemService(Context.TELEPHONY_SERVICE);
        String imei = m != null ? m.getDeviceId() : null;
        return imei;
    } 
     
    /*protected static String getDeviceId(Context context) throws Exception { 
        String imei = getImei(context); 
        if (imei != null) return imei; 
        String tid = getWifiMacAddress(context); 
        return tid; 
    }*/ 
     
    protected static String md5(String s) throws Exception {
        MessageDigest md = MessageDigest.getInstance("MD5");
 
        md.update(s.getBytes());