对于我的应用程序,我需要跟踪用户的 android 设备 unique id,android 设备将由客户提供给员工,当他们使用该设备时打开我们的应用程序并键入一些代码。我们必须检查请求是否来 self 们员工的设备,然后我们才会打开应用程序。如果其他人的手机中有此应用程序,即使应用程序无法打开。这是客户想要的要求,我在谷歌上搜索了很多,发现链接很少。 试过这个但没有用
public static String getDeviceAndroidID(Context context)
{
String android_id = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
if(android_id != null)
return android_id;
else
return "";
}
试过了但没有得到“context.getcontentresolver()” 需要一些帮助,谢谢。
最佳答案
试试 Android.Provider
命名空间:
var android_id = Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId);
关于c# - 如何在 c# 中的 xamarin android 中识别 android 移动设备 uniqueid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38631354/