Code example for UUID

Methods: toString

0
		tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
		String tmDevice, tmSerial, androidId;
	    tmDevice = "" + tm.getDeviceId();
	    tmSerial = "" + tm.getSimSerialNumber();
	    androidId = "" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
	    UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
	    deviceId = deviceUuid.toString();
	} 
	@Override 
	public void onStart(Intent intent, int startid) {
		mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
	    mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
		mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
	} 
	@Override 
	public void onAccuracyChanged(Sensor arg0, int arg1) {
		// TODO Auto-generated method stub 
		 
	} 
	@Override 
	public void onSensorChanged(SensorEvent event) {