Tutorial: Flex for Android in 90 Minutes

If you are looking for a quick way to get started building Flex applications for Android (even if you don’t have an Android device), check out this tutorial: FlexAndroid90Minutes.pdf.

You can download the supporting materials here: FlexAndroid90Minutes.zip.

This tutorial will be posted as a DevNet article in a couple of weeks, but I already wanted to make it available here because a number of people have asked for it. It is based on the hands-on session I delivered at MAX, with additional information and instructions.

Here is a quick outline:

  • Part 1: Creating a Basic Mobile Application
  • Part 2: Using Mobile Item Renderers
  • Part 3: Navigating and Passing Information between Views
  • Part 4: Creating an Action Bar
  • Part 5: Integrating with the Device Capabilities (Dialer, SMS, Email)
  • Part 6: Using a RemoteObject
  • Part 7: Using a Local SQLite Database

In this tutorial, you build a fully functioning Employee Directory application. The end result is the application available on the Android Market. (Just search “Employee Directory” in the Android Market).

 

As always I appreciate your feedback to continue to improve the tutorial.

Thank You,

Christophe

Comments

  1. Lionel says:

    Thanks ! We need this stuff.

    Not all Adobe paying customers can afford to travel to the conferences, but we are in the font lines using the technologies and convincing others to do the same. I think Adobe would benefit from making quality information/training much more available to those who purchase their products.

    The Training from the Source books for instance should be included with the products they teach. Or at least coupons for discounts.

    Keep up the good work!

  2. Thanks

    Very Useful information for flex-air developer :)
    great work

    Thanks
    Manoj

  3. I’m really enjoying all your Air samples, paarticularly the Android ones. Keep up the great work!

  4. Bookmark this page.. thanks.

  5. Litts says:

    This is great stuff .. Have already started implementing some of the ideas on my LIVE project . Wish we have more Adobe Evangelist like you . Great work

  6. Tom says:

    Excellent work Christophe–Digital Media Minute pointer of the day.

  7. Wayne says:

    Nice work! I love this. thanks.

  8. Avi says:

    This is simply great! Thanks for your support to Flex Society…hats of to you.

  9. Hassan Mian says:

    Thank you very much. Very appreciated

  10. tadeusz says:

    great stuff. Ben Forta was presenting it in las vegas

  11. Christophe/anyone…

    I walked through this excellent tutorial and I’ve got the app running in the simulator and it works great. But when I hook it up to my Droid 2 that we got at MAX, the app loads, but I get no data. I can type in the input field, I can click the search button but I get no employee data. Did I miss something? Am I leaving something out?

  12. Andy,
    Di you add the WRITE_EXTERNAL_STORAGE permission (Part 7, step 5)?
    Christophe

  13. Christophe…

    Yes that line is there, although it actually looks like the problem might be a missing database file? Does the EmployeeDAO create the SQLite db file in addition to the tables?

  14. Yakov says:

    Well done, Christophe!

    Please check the server at flex.org- the RemoteObject below doesn’t answer

    <s:RemoteObject id="srv" destination="employeeService"
    endpoint="http://flex.org:8080/extras/messagebroker/

  15. Thanks for the tutorial! One question, when will burrito be able to run more than one operating system, for example, iPhone?

  16. Polaco says:

    Hi Christophe,

    Thanks a lot for this clear tutorial. I wonder if there is any way to read the device’s contacts list from air.
    How can I know which capabilities an Air application has over the cellphone (android)?

    thanks in advance,

    Polaco.

  17. Polaco says:

    Hi Christophe,

    Is there any support to add a bottom navigation menu just as the navigation content bar in order so a menu could be open when the user press the menu button like in standard Android Apps?

    regards,
    Polaco.

  18. Polaco says:

    I have implemented the bottom menu to emulate the same behaviour than when a user presses the menu button o a standard android app by launching an hgroup with the menu buttons using the PopUpManager and aligning it to the bottom of the page. I don’t know if this is the best way to implement this but works quite well.

  19. Jérémy says:

    Hello,
    I tried your example with just one Employee in the xml files and I get an error.
    Type Coercion failed: cannot convert mx.utils::ObjectProxy@4c8eac1 to mx.collections.IList.

    Is there any workaround for that ?

  20. Francesco says:

    Great work Christophe! It’s possible to use File.openWithDefaultApplication() to open PDF file from an AIR Application (multitasking)?
    F.

  21. AndyC says:

    Hi,
    Very useful. i worked through your examples but am having trouble reducing the gap between items on list which I need for another project
    Something like

    works in flashbuilder for AIR but not on the burrito mobile beta
    cheers

  22. Sudhakar says:

    One of the most systematic articles I have ever read on the net.

    Thanks alot.

  23. vl says:

    Would it be possible to reproduce this tutorial without FlashBuilder ( e.g. from command line)? Specifically: “adt” tool requires digital certificate to deploy apk file. Does “Burrito” take care of that?

  24. Excellent demo!
    @AndyMatthews

    Check your search button:
    <s:Button icon="@Embed('assets/search.png')" click="data = srv.findByName(key.text)”/>

  25. Remo Harsono says:

    Great tutorial. pretty clear, concise and structured…thanks :)

  26. thoth23 says:

    @AndyMatthews

    Wondering if you ever got the app working on your phone. I am having the same issue on a Droid X.

  27. TerryC says:

    The tutorial was great. Thanks so much. What do you consider the best way to synchronise my mobile application with my SQLServer. Updates will be very frequent and my users may not be connected to the internet all the time. So when online they will want to fetch new data and push their changes.

  28. chetan says:

    i am trying to make Flex for Android in 90 Minutes through your tutorial.
    i want to change the names used in the application.but your xml files are read only.please tell me how to change the names.for example i want to use chetan instead of james.tell me how to do that.

  29. SMS says:

    A nice informative tutorial . I learned something. Thank you for taking the time to do all of that.

  30. Monika Sharma says:

    Very nice and neatly explained. However it does need a pre understanding of remote objects and the server side implementation. Thanks for a clear example :)

  31. Kritner says:

    @cheetan you can set readonly flags to not true (at least from windows) by right clicking the file from explorer, properties, and then unselecting read only. IIRC eclipse will warn you about attempting to make modifications to a read only file and will reset the flag for you after confirming.

    I had made changes to my xml files and the changes weren’t coming through, don’t know if it was caching the file or not, i tried cleaning the project etc. Once building a final release build my changes to the xml file were apparent, but not prior to.

  32. Kritner says:

    @Kritner (myself) I guess I see why I wasn’t seeing changes done to my xml file on my own system, but was after exporting final release to my phone. The database is created via the DAO and as long as the database exists, there’s no reason to recreate it after each run of the app… so destroying the database would fix the problem of not seeing updates done to the xml file.

  33. Pradipta Roy says:

    I went through the article and I have tried to implement the same thing with the Flash builder 4.5, but I was unable to find the spark.compoments.MobileItemRenderer or MobileiconItemRenderer class. is there any specif swc file that include these classes rather than the spark.swc or am I missing anything?

  34. Lluis Falco says:

    Pradipta Roy i had the same problem as you, it seems that for flash builder 4.5 ” has changed into do this change and it will work.

    Awesome work making this tutorial, on step 2 right now but moving forward, Thanks!!

  35. Lluis Falco says:

    I didn’t read the small text under this hehe i can’t post tags.

    The thing you need to change is: MovileIconItemRenderer for IconItemRenderer

  36. Pradipta Roy says:

    Lluis Falco, thanks for your reply. I have tried the IconItemRenderer and it worked fine. thanks for your help.

  37. Ivan says:

    @Andy Matthews @thoth23 I got same problem on htc desire. Did you resolve it? First time debugger said: Cant open database “FlexMobileTutorial.db”
    second time: Cant open database “.”

    Any help?

  38. Ivan says:

    I found a solution. I replaced ‘documentsDirectory’ with ‘applicationStorageDirectory’

    var file:File = File.applicationStorageDirectory.resolvePath(“FlexMobileTutorial.db”);
    /* ORIGINAL var file:File = File.documentsDirectory.resolvePath(“FlexMobileTutorial.db”);*/

    I hope it is OK solution.

  39. garage shoes says:

    Thank you! Excellent work-Christophe pointer Digital Media at the minute of the day.

  40. lee says:

    Hi Chris,

    I’ve been searching for a while for something like this… Although I won’t be using this as an employee directory – it will do the perfect job! However, is it possible to do the following:

    (In this case employees)

    Instead of jumping straight to the directory section. Have multi level categories?
    e.g: Company > Area of company (ceo office, customer service etc) > Employee directory.

  41. Naveen says:

    Hello ,
    Is it possible to read the phone contacts using flex mobile api.
    Please Let me know
    Thanks

  42. NXU says:

    Hi Christophe,

    I wonder if you could help. We have acquired some education resources devleoped on Shockwave flash .swf files and then all of them are delivered via a wrapper.html. I would like to see how much work is required to get these swf files to run on the playbook ? we are looking at giving some playbooks to our students and would like to load these resources as apps for them to run. I have had a brief look at adobe air ( i am not professional flash developer) and seen the need for config,xml etc which this application ( developed for windows platform) has. Assuming that xml / html and swf files are portable I am wondering what more need to be done to get the application to work on Blackberry playbook.

    I would be very grateful for any feedback.

    Thanks and Kind Regards
    Nalin.

  43. law attorney says:

    Good article thanks Welcome to my web site
    school summary

  44. Interesting flex tutorial for programmers.
    Thanks

  45. Thanks for the tutorial it really cut down the guess work for a non technie like me.

  46. David says:

    Hi…. (So sorry, my english is not good)
    I have a question:
    How can i select a background imagen for the app ?
    Thx there !!

  47. TurtleSoup says:

    Your tutorial has been very helpful. I wish I’d found it earlier, as it would have saved me lots of time.

    Many thanks for spending time to do this.

Trackbacks

  1. [...] — Li YongFei @ 11:59 pm Christophe Coenraets has posted a new Flash tutorial: Flex for Android in 90 Minutes, this tutorial will tell you a quick way to get started building Flex applications for [...]

  2. [...] rest is here: Tutorial: Flex for Android in 90 Minutes This entry was posted in Adobe, Flash, Flex 2.0, Google, flex and tagged Adobe, android, [...]

  3. [...] Christophe Coenraets created a great self-paced, step-by-step course on building your first mobile app using Flex….and the resulting app is very useful.  You can find the course at http://coenraets.org/blog/2010/12/tutorial-flex-for-android-in-90-minutes/ [...]

  4. [...] Christophe Coenraets Rich Internet Applications, Flex, AIR, Java, Android Skip to content BioAIR SamplesAIR Web ServerAIR Application with Embedded TomcatAIR for Android SamplesEmployee Directory on AIR for AndroidVoice Notes for AndroidReal Time Trader Desktop for AndroidEmployee Directory — Android Market App Companion PageAndroid SamplesTutorial: Building an Android Application in 6 Steps « Tutorial: Flex for Android in 90 Minutes [...]

  5. [...] Christophe Coenraets created a great self-paced, step-by-step course on building your first mobile app using Flex….and the resulting app is very useful.  You can find the course at http://coenraets.org/blog/2010/12/tutorial-flex-for-android-in-90-minutes/ [...]

  6. [...] night, I downloaded the new BlackBerry Playbook SDK and thought it would be fun to try to run the Employee Directory application I had just blogged earlier in the day (as an Android tutorial) in the Playbook Emulator. It turned [...]

  7. [...] evangelist Christophe Coenraets recently made available an extremely helpful tutorial called Flex for Android in 90 minutes (.pdf). In around 90 minutes, [...]

  8. [...] If you want to learn how to build these applications, check out my 90 minutes Flex Mobile Tutorial. [...]

  9. [...] Christophe Coenraets in hazırladığı Flex ile ilk mobil uygulamanız derslerine göz atabilirsiniz. Dersi bu adresten görebilirsiniz http://coenraets.org/blog/2010/12/tutorial-flex-for-android-in-90-minutes/ [...]

  10. [...] Christophe Coenraets created a great self-paced, step-by-step course on building your first mobile app using Flex….and the resulting app is very useful.  You can find the course at http://coenraets.org/blog/2010/12/tutorial-flex-for-android-in-90-minutes/ [...]

Speak Your Mind

*