Does Android have a UDID like IPhone? If yes, is there a way I can get it programatically?
Thanks Chris
It's very easy to get the Android UDID - check out the following code:
public class DemoActivityActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
Log.d(">>>>", "Android ID: " + Secure.getString(getContentResolver(), Secure.ANDROID_ID));
Log.d(">>>>", "Device ID : " + tm.getDeviceId());
}
For getting the Device ID you have to set following permission in AndroidManifest.xml:
For getting the Android ID you don't need to set any permission.