我正在开发中,我想获得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()