要获取 Android 手机/平板电脑上的唯一设备 ID,我们使用以下方法:
((TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId()
但是对于 Kindle Fire,我们买不到。
有什么想法吗?
最佳答案
您应该尝试使用以下行:
deviceId = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
这将从平板电脑获取设备 ID,您使用的代码仅适用于手机(它将在平板电脑上返回 null
)
关于android - 如何获取 Amazon Kindle Fire 的唯一设备 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8323326/