Code example for TelephonyManager

Methods: getDeviceId

0
 
	public static String getDeviceIDHashed(final Context ctx) {
		if(IMEI_HASHED == null){
			try{ 
				final TelephonyManager tm = (TelephonyManager)ctx.getSystemService(Context.TELEPHONY_SERVICE);
				final String imei = tm.getDeviceId();
				IMEI_HASHED = MD5.hash(imei);
			}catch(Throwable t){
				/* Workaround for custom builds, that deliver no IMEI or are not MD5 capable. */ 
				IMEI_HASHED = IMEI_HASHED_DEFAULT + "_"+ System.currentTimeMillis();
			} 
		} 
		return IMEI_HASHED;
	} 
 
	public static String merge(final String[] src, final String seperator){
		return merge(src, 0, src.length, seperator);
	} 
 
	public static String merge(final String[] src, final int start, final int length, final String seperator){
		final StringBuilder sb = new StringBuilder();