参考:https://www.cnblogs.com/xd502djj/p/5799334.html
https://blog.csdn.net/aaaym/article/details/126316223
https://blog.csdn.net/aaaym/article/details/126316223
/// <summary> /// 获取设备号 /// </summary> /// <returns></returns> public static string GetAndroidId() { var context = Android.App.Application.Context; var deviceId = Android.Provider.Settings.Secure.GetString(context.ContentResolver, Android.Provider.Settings.Secure.AndroidId); return deviceId; }
Android10以下
if (Convert.ToInt32(Android.OS.Build.VERSION.SdkInt) < 28) { return Android.OS.Build.GetSerial(); }