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
  • Pingback: Sample Application using Flex and AIR for Android | Lively Flash Tuts()

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

  • Pingback: Flex on Android in Flash Player and AIR()

  • Pingback: Get started with AIR on Android before you get an Android device! « Greg Wilson's Ramblings()

  • Nathan5.x

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

    Really interesting and encouraging … ;)

    Keen to surf more on this series..

  • Cenker

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

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

  • fisher

    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!

  • Gert Vanspringel

    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.

  • Gert Vanspringel

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

  • Kalavati Singh

    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.

  • Pingback: Adobe Flash Platform, Sparx Enterprise Architect and more ! « dkor()

  • CSNPrasad

    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?

  • Arindam Biswas

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

  • shyam

    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.

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

    Thank you!

  • hi,

    your application crashs on emulator with AIR 2.5

  • Eric

    Source not working…

  • Ram

    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

  • shyan

    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

  • Tahir Alvi

    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

  • Willy

    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

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

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

  • Geo

    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

  • Pingback: Employee Directory Sample Application Using Flex and AIR for Android – Updated for Froyo()

  • Tom G

    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

  • Pingback: SUREUN.NET | 열태의 서른넷 » Flash Builder 4에서 안드로이드 어플리케이션 개발하기()

  • Glen Harris

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

  • Glen Harris

    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!

  • Arthur Alva

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

  • Jorge

    Hi everybody?

    I cant download the source code (EmployyeDirectory.fxp)

    Can anybody send me this file?

    I thank you in advance

    jservingo@gmail.com

  • Sanjay Bharekar

    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

  • Pingback: Simulare aplicatie android()

  • Jai

    Hi,

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

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

  • Ruyam

    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…

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

  • Yasar

    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.

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

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

  • Pingback: ReCode()

  • Johnny Chang

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

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

  • Saurav

    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.

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

  • Pingback: new thoughts on mobile apps | codefail()

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

  • Patricio

    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

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

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

  • 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

  • Thank you very much.

  • Kelvin

    it’s great, thank you .
    So if i want to extend app,At employee details form ,when i swipe left ( right ) then will show next ( previous ) employee details
    how can i do that , help me plz

css.php