参考:https://www.cnblogs.com/xd502djj/p/5799334.html
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();
}

  

posted on 2022-12-26 16:45  邢帅杰  阅读(379)  评论(0编辑  收藏  举报