get Device id in Adobe Air

徘徊边缘 提交于 2019-12-11 11:42:45

问题


For get device id in android sdk i wrote simple This code ::

import android.provider.Settings.Secure;

private String android_id = Secure.getString(getContext().getContentResolver(),
                                                        Secure.ANDROID_ID); 

but i need it in Adobe air app. how can i do that?


回答1:


you can now use Native Extensions on other platforms other than TV with AIR 3.0.

Info: Extending Adobe AIR

API: flash.external.ExtensionContext




回答2:


We have recently developed an ANE that has tried to solve this problem by giving you access to different device identifiers. You can try the ANE here https://github.com/myflashlab/UDID-ANE

The ANE provides you with the following Identifiers:

  • Android ID
  • Serial Number
  • Telephony Device ID
  • Telephony Subscriber ID
  • UUID
  • Unique Vendor ID

import com.myflashlab.air.extensions.udid.UDID;

UDID.init();
if(UDID.OS == UDID.ANDROID) 
{
    trace(UDID.androidId);
}
else if(UDID.OS == UDID.IOS) 
{
    trace(UDID.vendorId);
}



来源:https://stackoverflow.com/questions/7979300/get-device-id-in-adobe-air

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!