10 Dec 2015

Getting The Device's UUID

Below code snippet will help you to get the device’s uuid..

	TelephonyManager tManager = (TelephonyManager)
						getSystemService(Context.TELEPHONY_SERVICE);
	String uuid = tManager.getDeviceId();

In order to make this code snippet legal, we need to define the following xml node in the application manifest:

	<uses-permission android:name = "android.permission.READ_PHONE_STATE"/>


Tags:
Stats: