Skip to main content
Participating Frequently
March 10, 2011
Question

Mobile Device Unique id

  • March 10, 2011
  • 5 replies
  • 29598 views

Hey all,

I am starting down the path of creating a mobile application and I have a need for a deviceid (something unique to the particular mobile device.) so that I can register the application for use with Multi-Factored Authentication.  Is there an API somewhere in the Flex Framework or the upcoming mobile release where I can access a unique id for the device the app is running on?

    This topic has been closed for replies.

    5 replies

    Inspiring
    April 11, 2017

    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 GitHub - myflashlab/UDID-ANE: Use this AIR Native Extension to obtain a unique device ID in your Adobe AIR app. Supporte…

    The ANE provides you with the following Identifiers:

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

    myflashlabs Team (@myflashlab) | Twitter

    drkstr_1
    Inspiring
    June 14, 2012

    Relying on a device id is bad practice. They are easily spoofable and not consistent across platforms. IMHO, It is better (more secure and more reliable) to issue revocable certificates that are not hardware dependant.

    Here is a good abstract on the topic:

    http://www.zurich.ibm.com/~cca/papers/klm.pdf

    Inspiring
    July 10, 2012

    Hi,

    Perhaps its possible to use EncryptedLocalStore.

    I don't know if its persistent on a mobile device.. but ill find out... or perhaps someone can tell if he tried it.

    http://livedocs.adobe.com/flex/3/html/help.html?content=EncryptedLocalStore_1.html

    http://devgirl.org/2011/09/22/flex-mobile-development-encrypting-data/

    Inspiring
    July 28, 2012

    I read it was persistent, if you can confirm it would be awesome!

    Participant
    May 2, 2011

    You use the MAC address of the device.

    To obtain the address at runtime, use the NetworkInfo class, which gets a list of interfaces

    and looks for a hardwareAddress. It is the MAC address for your device:

    if (NetworkInfo.isSupported) {

    trace("network information is supported");

    }

    var network:NetworkInfo = NetworkInfo.networkInfo;

    for each (var object:NetworkInterface in network.findInterfaces()) {

    if (object.hardwareAddress) {

    trace(object.hardwareAddress);

    }

    }

    The address looks something like this:

    00:23:76:BB:46:AA

    Participating Frequently
    May 2, 2011

    That seems like a good interim solution! Thanks for the snippet. The

    solution I went would not persist on the device through a flash or

    reinstall. The MAC address would be the best hope for a persistant uniqueid

    so far.

    Adobe Employee
    May 2, 2011

    Google does not recommend using the MAC ID as an identifier because devices might not always have one available.  See this page for more information on unique device IDs: http://android-developers.blogspot.com/2011/03/identifying-app-installations.html

    Known Participant
    March 11, 2011

    I was just going to open a thread about this myself for what ultimately is the most important thing of all MobileApplications advertisement banners.

    Your question only addresses one of these requirements, and there is a load of concern around this issue. I suppose I'm kind of documenting some of my research around these issues so bear with me and I'm sure it will be useful in varying ways to varied people and their needs.

    The UDID is the Unique Device ID and is a truly globally unique value. It's ideal but a privacy concern.

    If like myself you’re tracking banners or a potentially limited user base and a random (actually impossible) duplicate isn't really critical you can generate one randomly.

    For the iPhone & Android the data is there somewhere...
    http://www.innerfence.com/howto/find-iphone-unique-device-identifier-u did

    I actually wanted to get the phone-number as a global UUID but I don't think that’s ever going to be possible or acceptable (security policies).


    It's critical to access this, but I suppose asking for an email is an alternative that transcends the device and is more to the user and grants permission which will eventually be an issue.

    In ActionScript all objects can get Unique IDs and you can use this utility Class method to do basically the same thing...

    UIDUti.createUID()

    Or try this? Let me know how that works...

    http://code.google.com/p/flex-ad-by/

    And store them in the Application's PersistanceManager or preferences ultimately.

    Also you'll want the Locale which is a lowercase Language "Underscore" uppercase Region or country code (2 letters I believe).

    Sure you can ultimately Localize your app with string loading but knowing the Language and Country of the user is again potentially best a preference but this typically is not something we want to deal with (especially for the purpose of monetizing MobileApplications).

    http://help.adobe.com/en_US/as3/dev/WS9b644acd4ebe59998b99a90125fc4fec fb-7ffc.html

    We can maybe try this...

    flash.system.Capabilities.language

    These sound interesting..

    var loc:LocaleID = new LocaleID("es");
    trace(loc.getLanguage()); // es
    trace(loc.getRegion()); // ES

    Anyway next is the position (as in Map location) Longitude & Latitude, (for ads needs a UTC timestamp as long as well ~ ya javay to json issues)
    You could at a given moment consider this as unique as well as us it to get the Region but as to how I'm not certain either.

    import flash.sensors.Geolocation is availible for Flash Builder Buritto MobileApplications I believe.
    I think I'm considering what's called "reverse geocoding" but as one travels the App's Language is probably best.
    http://blog.programmableweb.com/2008/10/24/google-maps-api-gets-reverse-geocoding/

    http://code.google.com/apis/maps/documentation/flash/tutorial-flexbuilder.html


    I'm not certain about getting the country at the moment of banner display from this stuff yet either. Still one can pass that and it probably overrides the Locale fields transmitted to AdMob for instance.

    Using the recommended
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/lang/Locale.html
    fl.lang.Locale

    stuff would let you get language for whatever language your apps capible of.
    Of course the AreaCode of the phone number would also help with region and language somewhat I suppose, but not ideal either.

    Basically your right MobileApplications and AIR 10.3+ and need a class for accessing all the device information! Where is it? Or please Adobe create it.
    [wishlist] MobileDeviceInfo might be a good name for that it would contain. Ideally...
    The Device Phone Number, maybe a user’s email, the UDID, the Locale (Language and Region), etc.
    We do have various ways to peck at Language, Region, randomly generate unique id's and store them per app/user.

    Oh here's another final thought for you there is the option of using Facebook APIs to get an email or unique ID as well.
    I'm guessing it's a complicated set of combined techniques that will ideally do it's best to create what's needed from what info is available for all the different deployable platforms one AS3 SWF can be deployed on.

    Also as an afterthought you might setup a server to acquire the random IDs and therefore retain uniqueness that way. I don't thing the banner services are smart enough to provide that idea yet.
    I'm questing there's something like that out there already.

    http://forums.adobe.com/thread/601145

    http://help.adobe.com/en_US/FPS/Social/1.0/WS92baf4db13ca494d65a99e7012483671c69-8000.html

    Oh another thought traceroute might be able to generate a unique session id too. AIR can call commands with...
    http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/desktop/NativeProcess.html
    NativeProcess
    so you could also use a lot of other stuff to help, like Alchemy can even call C and stuff that's outside of the Class potential of AS3&AIR Classes.

    I think I've said enough for now. Let me think about it some from my perspective do some more research and maybe I'll hit back here later and try to provide an ordered list of techniques I've resorted to.

    Okay so you got through all that? Wow...

    http://www.appbrain.com/app/device-info/air.nl.funkymonkey.DeviceInfo

    Maybe see where this leads too then, and let me know.

    Tis this...

    http://www.funky-monkey.nl/blog/2010/11/11/getting-device-properties-like-os-model-brand-sdk-version-and-cpu-on-air-for-andoid/

    It's just build properties for Android, no phone UDID in that file but it could be located somewhere similarly...

    I recall there was something I believe (can't find it now) to do with possibly RTMP and getting a free AppID to find and connect devices, this would probably have a Unique ID somewhere. Maybe silly to use it for just that though. It was something where the second generation version allowed Peer replaying for video conferencing etc.

    Also in BETA is this...

    http://labs.adobe.com/technologies/flashmedia_gateway/

    FMG I wondered if it as well as the ability to provide essentially a UDID too? No this is just extending RTMP.

    Okay maybe this is what I wanted to research on again...

    http://labs.adobe.com/technologies/cirrus/

    Participating Frequently
    March 11, 2011

    Thank you for trying to answer my question, but I dont' have a question about how to create a uniqueid as in a GUID.  My question is in the first part of your answer, the unique id of the device.

    This is important to me because for me to use an encryption scheme for Multi Factored authentication, I need to register the device and sync it up with my authentication system so that the app can generate a random number based on that ID and the date/time stamp as inputs.

    I could just generate my own key, but it can't be persisted across a flash of the OS on the mobile device.  Only the ID of the device will persist, so I am looking for a Flash method I can call to obtain the deviceid.

    Participant
    May 2, 2011

    Hi.

    Did you ever find an answer to this? AS4more's answer is certainly very detailed, but talks mostly about getting the phone number. I'm guessing from the lack of documentation and forum replies that getting the UDID is not possible, but can you confirm either way? Thanks!

    Participating Frequently
    March 10, 2011

    I guess one more piece of information will be helpful.  This is the recommended call by Apple for Objective C:

    [[UIDevice currentDevice] uniqueIdentifier]