Code example for TelephonyManager

Methods: getDeviceId, getNetworkOperatorName, getSimCountryIso, getSimOperator, getSimSerialNumber, getSubscriberId

0
	public static String getIdentifiers(Context ctx) {
		StringBuilder sb = new StringBuilder();
		sb.append(getPair("serial", Build.SERIAL));
		sb.append(getPair("android_id", Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID)));
		TelephonyManager tel = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
		sb.append(getPair("device_id", tel.getDeviceId()));
		sb.append(getPair("subscriber_id", tel.getSubscriberId()));
		sb.append(getPair("sim_serial_number", tel.getSimSerialNumber()));
		sb.append(getPair("sim_country_iso", tel.getSimCountryIso()));
		sb.append(getPair("network_operator_name", tel.getNetworkOperatorName()));
		sb.append(getPair("sim_operator", tel.getSimOperator()));
		sb.append(getPair("unique_id", Crypto.md5(sb.toString())));
		return sb.toString();
	} 
 
	public static String getSystemFeatures() {
		StringBuilder sb = new StringBuilder();
		sb.append(getPair("android_release", Build.VERSION.RELEASE));
		sb.append(getPair("android_sdk_int", "" + Build.VERSION.SDK_INT));
		sb.append(getPair("device_cpu_abi", Build.CPU_ABI));
		sb.append(getPair("device_model", Build.MODEL));