Skip navigation
david_yen
Currently Being Moderated

How to get Android IMEI / UDID with Flash CS6?

Jan 4, 2013 12:00 AM

Tags: #android #extensions #cs6 #ane #udid #imei

Hi. I understand that a Native Extension is needed to get the IMEI or UDID of the Android device. I found one here:

 

http://blog.snowflax.com/native-imei-action-script-extension-for-andro id/

 

I ran the compiled sample this site provided and it retrieved my IMEI fine, so I know it works.

 

However, the code for this sample is in Flex. When I tried to incorporate it into my Flash CS6 .fla it didn't work. There were no errors, but when I ran in on the Android device nothing happened when I clicked on the button to retrieve the IMEI. I don't know what went wrong. Here is what I did:

 

1. First, I imported the "IMEI.ane" file using the steps below:

http://www.adobe.com/devnet/air/articles/using-ane-in-flash.html

 

2. Then in my AIR 3.2 for Android settings I included the "IMEI.ane" file in the publish General settings.

 

3. In my program there is a textbox and a button. When the button is clicked with a mouse, it calls the function below and places the returned string in the textbox. I know the string to textbox part works, however, when I call the function below it doesn't.

 

       import com.chi.imei.Deviceimei;

       import com.chi.imei.DeviceStats;

 

              private function mGetImei():String

              {

                     var tImeiStr:String = " ";

                    

                     var obj:DeviceStats = Deviceimei.deviceimei.deviceinfo();

                     tImeiStr = obj.imei.toString();

                    

                     return tImeiStr;

              }

 

4. My FlashDevelop intellisense recognizes all the lines above so I think it properly found the classes. However, it doesn't work on the device! Can anyone tell me how to fix this?

 

Thank you!

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points