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

Comments

  1. Daliz says:

    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 says:

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

    Really interesting and encouraging … ;)

    Keen to surf more on this series..

  3. Cenker says:

    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. Very good. One of the best articles about this theme I ever read.

  5. fisher says:

    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 says:

    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 says:

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

  8. Kalavati Singh says:

    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 says:

    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 says:

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

  11. shyam says:

    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 says:

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

    Thank you!

  13. Iteratif says:

    hi,

    your application crashs on emulator with AIR 2.5

  14. Eric says:

    Source not working…

  15. Ram says:

    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 says:

    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 says:

    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 says:

    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 says:

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

  20. Geo says:

    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 says:

    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 says:

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

  23. Glen Harris says:

    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 says:

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

  25. Jorge says:

    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 says:

    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 says:

    Hi,

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

  28. Create Games says:

    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 says:

    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 says:

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

  31. Yasar says:

    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. 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 says:

    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 says:

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

  35. 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.

Trackbacks

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

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

  3. [...] 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 [...]

  4. [...] 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). [...]

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

  6. [...] 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 [...]

  7. ReCode says:

    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 ……

Speak Your Mind

*