简体   繁体   English

Android设备UDID还是唯一ID?

[英]Android Device UDID or unique ID?

我想为我的Android应用程序生成android设备唯一ID,以根据用户设备udid创建收藏夹。

All devices have a unique id. 所有设备都有唯一的ID。

 import android.provider.Settings.Secure;
 private String android_id = Secure.getString(getContext().getContentResolver(),
                                                            Secure.ANDROID_ID); 
private String uDiD = Secure.getString(getContext().getContentResolver(),
                                                        Secure.ANDROID_ID); 

You can use different values as udid. 您可以使用不同的值作为udid。 The above mentioned Secure.ANDROID_ID has some cons It can be null It is same on 2.2 and some 4.2 devices You can use MacAddress of device or IMIE address(Can be null on devices without cellular connection) 上面提到的Secure.ANDROID_ID有一些缺点它可以为null它在2.2和一些4.2设备上是相同的你可以使用设备或IMIE地址的MacAddress(在没有蜂窝连接的设备上可以为null)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM