获取UDID的机器人机器人、UDID

2023-09-04 05:51:07 作者:要死趁早好吗

我正在开发中,我想获得Android模拟器的UDID一个Android应用程序。 我怎样才能做到这一点?

I am developing an android application in which I want to get UDID of android emulator. How can i do it?

在此先感谢, 图莎尔

推荐答案

我不知道这是否是你追求的是什么,但你可以使用:Settings.Secure.ANDROID_ID

I'm not sure if this is what you're after but you could use: Settings.Secure.ANDROID_ID

public class YourActivity extends Activity {
    //...Omitted code
    public String getId() {
        String id = android.provider.Settings.System.getString(super.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
        return id;
    }
}

请注意,这不是一个IMEI号码,如果你需要这个应用        getDeviceId()

Note that this isn't an IMEI number, if you need this use getDeviceId()