安卓设备ID应该有多长?

9

请问在Android设备中UDID的长度是多少?因为我在Android设备上得到的UDID只有16个字符,而iPhone的UDID长度为40个字符。

我使用以下代码来检测ID:

id = android.provider.Settings.System.getString(super.getContentResolver(),
    android.provider.Settings.Secure.ANDROID_ID);

你是如何获得 UUID 的呢?另外,我认为没有具体的大小强制执行,所以最好不要假设所有 Android 设备的长度都相同。 - FoamyGuy
id = android.provider.Settings.System.getString(super.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);id = android.provider.Settings.System.getString(super.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); - SampathKumar
我只是分析了iPhone和Android的长度(UDID)。 - SampathKumar
哦,对不起,我没有意识到你是提问者。请不要在回答中发布代码,而是编辑你的问题以包含代码。 - FoamyGuy
2个回答

11

8
我有两个设备使用这段代码。
String device_id =  Secure.getString(getContentResolver(), Secure.ANDROID_ID);

请注意,获取UID的这种方法并不是百分之百可靠的。参考:Is Secure.ANDROID_ID unique for each device?Is there a unique Android device ID?。使用时请自行决定风险 =) - FoamyGuy
也得了15分。 - Steve Moretz

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接