Q : How to read Device-id in Xamarin Android?
Ans:
Some times we want to read Device-id while developing the app's.
this code will help you to read the device-id in Xamarin Android.
i use the below code to read the device-id in my app.
- Create a Xamarin Android project.
- Right click on your project -> properties -> Android Mainfest.
- it will display as below.
- select the READ_PHONE_STATE option.
- then go to your activity page.
- add the line"using Android.Telephony;".
- you can write the code in OnCreate method.
TelephonyManager tM = (TelephonyManager)GetSystemService(Context.TelephonyService);
String uid = tM.DeviceId;
you can read the device-id like this.
thanks for sharing this message
ReplyDeletebest hadoop training in chennai
best hadoop training in omr
hadoop training in sholinganallur
selenium training in chennai
selenium training in omr
selenium training in sholinganallur
best python training in chennai
Thanks for article.
ReplyDeletearchitect in agra