How to get IMEI from Android or iPhone

For android it's pretty straight forward. You just have to add read phone state permission.

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

And call the API:
String imei = TelephonyManager.getDefault().getDeviceId();
if (TextUtils.isEmpty(imei)) {
  return "";
}

For iPhone I guess IMEI is not accessible as you could read on most articles. But perhaps you can use the device unique identifier.

UIDevice *myDevice = [UIDevice currentDevice];
NSString *deviceUDID = [myDevice uniqueIdentifier];
How to get IMEI from Android or iPhone How to get IMEI from Android or iPhone Reviewed by Edward Legaspi on Wednesday, February 09, 2011 Rating: 5

No comments:

Powered by Blogger.