Sample Application using Flex and AIR for Android

Here is a simple Employee Directory application I wrote to demonstrate how to build Flex applications for Android using the AIR runtime.

Watch the video:

The key point when you look at the source code of this application is that you build Flex applications for Android the exact same way you build Flex applications for the Browser and the Desktop: same programming model, same language, same tools, same code. This application for example uses a local SQLite database on your device that you access using the same database API you’d use for any other Flex application running on the AIR runtime.

The other good news is that you have access to additional APIs (GPS, accelerometer), and you can integrate with other applications on your phone (dialer, SMS, email, etc).

Download the Application and Source Code

  • You can download the application (EmployeeDirectory.apk) here
  • You can download the source code (EmployeeDirectory.fxp project file) here

50 Responses to Sample Application using Flex and AIR for Android

  1. Daliz May 21, 2010 at 7:38 am #

    Tried it on Motorola Milestone (Droid) running Eclair.
    It works fine, thank you for sharing. Anyway the “ListView” suffers of slow scrolling. I think it’s due to the lack of hardware acceleration on this Air Prerelease.

  2. Nathan5.x May 24, 2010 at 10:32 pm #

    Wow.. Thank you very much for sharing this code.

    Really interesting and encouraging … ;)

    Keen to surf more on this series..

  3. Cenker May 25, 2010 at 10:51 pm #

    It’s so exciting to integrate Air/Flex app with Android. I am starting to code with your sample immediatelly. Thanks for sharing again…

  4. Sir Backgammon May 27, 2010 at 8:03 am #

    Very good. One of the best articles about this theme I ever read.

  5. fisher May 28, 2010 at 1:26 am #

    Hi, Christophe. Thank you very much for your shaing!

    I have some question about the source code:

    1. On the instruction “Developing Adobe AIR Applications for Android” (by Adobe), page 12, it is said that the “Main application file” should be .as file rather than .mxml. However I notice that in your source code the main application file is a .mxml file(“EmployeeDirectory.mxml”). This make me confused?

    2. How can I package your application in the EmployeeDirectory.fxp file(under /bin-debug) to a .apk file? or should I convert the application to another format such as .air first?

    I am in China, so I cannot watch your video on youtube, in which maybe the questions have been answered.

    Looking for your reply!

    Thank you!

  6. Gert Vanspringel May 31, 2010 at 3:51 am #

    Christophe,
    Thank you very much for sharing this.
    1) Installed fxp in flash builder, compiled and installed on HTC Desire(Eclaire). Error view. Is there a way to find the error code?
    2) Confused because I undertood only as3 was supported for the moment.
    3) Going to try your apk file.
    4) @sher: Import the fxp-file into flash builder. Then follow the instructions in the adobe pdf.

  7. Gert Vanspringel May 31, 2010 at 5:05 am #

    Installing your apk gives Errorview too on HTC desire with Eclaire. Where can I find the error codes?

  8. Kalavati Singh June 1, 2010 at 12:18 am #

    Its very good to hear that Android 2.2 now supports Flex 4. I have a querry , I would further request you to clarify me. I have developed a Flex application on windows a couple of months ago( Windows XP , Flex 3) Currently my client wants the same application on Android, Can it possible. let me know in case you need any details on my end.
    Let me also know the License part of Android.

  9. CSNPrasad June 2, 2010 at 4:23 am #

    I have a flex application running on Firefox and want it to run in Android browsers,is it directly portable to Android browser or need to do any scaling or skinning for compatible?

  10. Arindam Biswas June 2, 2010 at 2:51 pm #

    Very very cool. Have been looking forward to building on Android using as3. The time has come, LET THE GAMES BEGIN! :-)

  11. shyam June 7, 2010 at 4:48 am #

    hai,

    i tried running this application in emulator but i am getting the following error, i had got the info from the dalvik debug monitor.

    Log:
    06-07 15:15:14.492: WARN/InputManagerService(51): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43bcf3d8

    Please help me in resolving this i am unable to run any app in the android emulator.

  12. bagicon June 7, 2010 at 10:40 pm #

    Very very cool.
    welcome to my site:http://www.bagicon.com

    Thank you!

  13. Iteratif June 8, 2010 at 3:57 am #

    hi,

    your application crashs on emulator with AIR 2.5

  14. Eric June 15, 2010 at 3:02 pm #

    Source not working…

  15. Ram June 17, 2010 at 1:10 am #

    Hi,

    Very cool app…..

    However, liked fisher asked, how is that you are using .mxml while the PDF on the AIR prerelease says that, .as must be used.

    Your help is very much appreciated
    Ram

  16. shyan June 18, 2010 at 8:50 am #

    I worked alot tryiing to run this app on android emulator but its useless, if any one had suceeded int his process please let me know.

    i even rebuilt the app but no using flash builder with source code but no use..

    thanks,
    Shyam.S

  17. Tahir Alvi June 23, 2010 at 1:57 am #

    Hello Respected Sir,
    i open this application ‘Employee Directory.fxp’ in Flash Builder and sdk i use Air 2.5 for this project, But it show an error every time.

    Please tell me the solution.

    Thanks

  18. Willy June 28, 2010 at 3:09 pm #

    Main app doesn’t have to be AS file, if you are using Flex 3, not working with Flash Builder 4 yet.
    I was writing my game in Flex 3, SDK 3.1 with AIR 2.5
    my UI is wrote in MXML, all controllers are in AS3.
    works fine in 2.2 emulator.
    http://www.flexcode.org/flex/sudoku.apk

  19. Rajat June 30, 2010 at 10:11 am #

    This is cool…i didnot know that flex would work on Android phones (as i thought its heavy) but it works great…..

  20. Geo July 2, 2010 at 2:35 am #

    Hi Christophe

    Yesterday (30 June) has been released the flex sdk update that updates the flex from version 4.o to 4.1 which adds AIR 2 and Flash Player 10.1 support to flex
    Does this version of the Flex SDK support the mobile (particulary Android 2.2) development?
    Or we need continue to use the AIR SDK 2.5 from https://prerelease.adobe.com in order to develop mobile applications?
    What about the next version of the flex sdk “Hero”? Will it incorporate AIR SDK 2.5 for mobile development?

    Regards
    Geo

  21. Tom G July 30, 2010 at 1:17 pm #

    Hi Christophe,

    Maybe you can clarify something for me. We use Flash Builder 4 for our web and desktop apps. I noticed in your application, you use both ActionScript and MXML files. In reviewing the recommendations on the Air for Andriod pre-release site, they are suggesting that applications should only include ActionScript since Flex is not optimized for mobile devices. Obviously, you’ve proven that it works, so is their warning simply a suggestion or is there a technical reason why MXML should not be used?

    Obviously, Adobe is addressing the mobile market with Hero, but that is a near-future solution. Can you provide some insights into what is possible now with MXML so that we can leverage re-use of existing components for our Android apps? Is there a different recommendation when considering a Flash vs. Air app on Android? We’re at the beginning of a new development cycle, so we can make these decisions fresh and not have any old baggage. But we need to have some demonstrable Android solutions over the next couple of months.

    Thanks for your insights.
    Tom

  22. Glen Harris September 23, 2010 at 4:55 pm #

    i’m not much of a developer, but I would love to have this application on my Epic

  23. Glen Harris September 23, 2010 at 4:56 pm #

    i’m not much of a developer, but I would love to have this application on my Epic, but I have no clue as to what I would need to do here. After downloading it to my phone, I received a “Force stop” error. Some help would be great!

  24. Arthur Alva October 26, 2010 at 3:46 pm #

    Great example! I liked the “The Office”s cast :)

  25. Jorge December 20, 2010 at 10:45 pm #

    Hi everybody?

    I cant download the source code (EmployyeDirectory.fxp)

    Can anybody send me this file?

    I thank you in advance

    jservingo@gmail.com

  26. Sanjay Bharekar April 12, 2011 at 4:13 am #

    Hi ,

    I am Sanjay, am new in mobile application.

    I have made one Mobile Android application using flex buritto. I want to deploy this application in my device.

    can you please help me for the same.

    Thanks
    Sanjay

  27. Jai June 9, 2011 at 11:56 pm #

    Hi,

    I was try to run this application but it was give an error

  28. Create Games September 8, 2011 at 2:04 pm #

    Thanks for the video. I am a beginner at this, I created an application for the Android, but I can’t find the right codes to put so it will have an Exit application option. I like your app.

  29. Ruyam September 13, 2011 at 1:59 am #

    Hi Friends….
    I dont think so “Christophe Coenraets” is interested in giving answers to your post….
    Can any one can tell me how to get the profile picture,,,I have tried a lot to get the image of the employee…I need help…

  30. Duncan Stoey October 28, 2011 at 2:01 am #

    Weight loss plans should always support healthful behaviors that help you lose weight and that you can stick with.

  31. Yasar November 29, 2011 at 7:24 am #

    hi. ı download the apk and its working on the pda and phone with air 2.5. I download fxp file and import in flex then export apk again. but its not working. Also all of the file whics s export from my flex dont working too. please help me from blueromans@hotmail.com. Thank u very much.

  32. Svetlana Levesgue December 7, 2011 at 3:10 am #

    Thanks for the new things you have disclosed in your blog post. One thing I would like to discuss is that FSBO connections are built as time passes. By presenting yourself to the owners the first saturday their FSBO is actually announced, prior to masses begin calling on Mon, you build a good network. By mailing them resources, educational components, free accounts, and forms, you become a good ally. By subtracting a personal desire for them and also their predicament, you produce a solid link that, on most occasions, pays off if the owners decide to go with a representative they know and trust — preferably you.

  33. keox December 13, 2011 at 3:01 am #

    Thank you very much that you share your code. I try to develop air / android from flash builder your source code very usefull to me.

  34. Johnny Chang February 8, 2012 at 12:03 am #

    anyone know about the gps source code in android via using flash builder?
    447587646@qq.com
    thanks advanced

  35. red wing heritage February 24, 2012 at 6:39 am #

    Sitios web.0 and additionally “Cloud” processing is definitely not different a particular launch associated with Discuss Power Colonel David Boyd’s hypotheses (Boyd’s Never-ending loop, or use the OODA Picture), because created by the united states Service, whereby people who undertake the particular cycle more quickly plus much more properly tend to be more responsive to community stresses, and definately will win all the battle with the hearts and minds and also mind in their target demographic.

  36. Saurav October 10, 2012 at 12:14 am #

    I am using Flex 3. Because the application descriptor was 1.5.3 version and was causing hard time creating APK via ADT, I downloaded the latest version of AIR. Then copied it to Flex Sdk 3.5. which then created . Now I ran everything …ran adt -package -target apk -storetype pkcs12 -keystore tacIdsCert.p12 testApp.apk testApp.air……created apk and install apk…but when I try to open the application in android, it stucks in firstpage. It acts like its having hardtime loading the swf or something. Please help me out. I wish I can attach my project for you guys.

  37. Bryan Ochoa. December 27, 2012 at 10:23 pm #

    Understanding the uncomplicated basics with car insurance will help you choose the right sort of insurance policy that may take care of your needs in case you happen to be involved in any accident.

  38. tallinna liikluskaamerad August 4, 2013 at 4:59 pm #

    I have been exploring for a little bit for any high quality articles or blog posts in this sort of house .
    Exploring in Yahoo I ultimately stumbled upon this website.
    Reading this info So i’m glad to show that I have an incredibly just right uncanny feeling I found out just what I needed. I so much undoubtedly will make certain to don?t disregard this website and give it a look on a constant basis.

  39. Patricio May 18, 2014 at 12:20 pm #

    Hi, I´m new to Flex, is it possible to recompile this app, reusing code, to run on a webserver like a normal website (discarting all the interactions with phone)?. I´m asking this because I want to develop an application to be run as an android app and a Facebook app. I do not want to have two versions one for Android and one for www. Regards

  40. IWeb Article July 1, 2014 at 11:47 pm #

    I constantly emailed this webpage post page to all my associates, for the reason that if like to read it then my contacts will
    too.

  41. deer hunter 2014 cheat on mac July 9, 2014 at 2:18 pm #

    Hey there! I know this is kinda off topic but I was wondering which blog platform are you using for this website?
    I’m getting tired of WordPress because I’ve had problems with hackers and I’m looking at
    options for another platform. I would be fantastic if you
    could point me in the direction of a good platform.

Trackbacks/Pingbacks

  1. Sample Application using Flex and AIR for Android | Lively Flash Tuts - May 21, 2010

    […] Direct Link […]

  2. Flex on Android in Flash Player and AIR - May 21, 2010

    […] Christophe Coenraets has posted some great Flex mobile demos. Check out his Employee Directory and Stock Trader […]

  3. Get started with AIR on Android before you get an Android device! « Greg Wilson's Ramblings - May 24, 2010

    […] Christophe Coenraets recently blogged Employee Directory app built with Flex on AIR for Android: […]

  4. Adobe Flash Platform, Sparx Enterprise Architect and more ! « dkor - June 1, 2010

    […] partner to work with. For example Christophe Coenraets has recently published a post concerning a Employee Directory beta application developed with AIR for the Android platform. And like this most most Adobe announcements are in […]

  5. Employee Directory Sample Application Using Flex and AIR for Android – Updated for Froyo - July 20, 2010

    […] I finally took the time to rebuild the Employee Directory application with the latest version of AIR for Android (available here) to run on Froyo. See the links below to download the apk and the source code. (If you are still running Eclair see my original post). […]

  6. SUREUN.NET | 열태의 서른넷 » Flash Builder 4에서 안드로이드 어플리케이션 개발하기 - September 13, 2010

    […] 알고 있었는데 아래의 샘플을 받아서 테스트해보니 실행이되네요.. http://coenraets.org/blog/2010/05/sample-application-using-flex-and-air-for-android/ 어제 하루종일 테스트할때는 실행이 안되더니,,, 안되는게 아니라 […]

  7. Simulare aplicatie android - June 3, 2011

    […] chiar bine fiind prima de genu asta … mai nou sunt aplicatii adobe flash/flex/air pe android http://coenraets.org/blog/2010/05/sa…r-for-android/ Raspunde cu citat   + Raspunde la […]

  8. ReCode - February 2, 2012

    Sample Application using Flex and AIR for Android…

    The key point when you look at the source code of this application is that you build Flex applications for Android the exact same way you build Flex applications for the Browser and the Desktop: same ……

  9. new thoughts on mobile apps | codefail - February 27, 2013

    […] Sample Application using Flex and AIR for Android […]

Leave a Reply

css.php