How to get device info IMEI programmatically in xamarin android

You'll need the following permission in your AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
in order to do this.

This will return whatever string uniquely identifies the device (IMEI for GSM, MEID for CDMA).
Code
Android.Telephony.TelephonyManager mTelephonyMgr;            
mTelephonyMgr = (Android.Telephony.TelephonyManager)GetSystemService(TelephonyService);
 //IMEI number  
 String m_deviceId = mTelephonyMgr.DeviceId;

Comments

Popular posts from this blog

SQL Interview Questions and Answers

Generic Interface and Factory Pattern in C#