Video: Build your First Desktop Application with Flash Builder

In this video I walk through the basics of building Adobe AIR desktop applications in Flash Builder 4 using the Flex 4 SDK. Let me know what you think.

This entry was posted in Adobe AIR, Flex. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

17 Comments

  1. Posted April 1, 2010 at 8:11 am | Permalink

    Never used that s:applicationComplete tag, looks quite handy!
    And I guess it exists for most (if not all) events, I’ll try that out!

  2. Posted April 1, 2010 at 8:15 am | Permalink

    @Quentin

    That is just another way to set an event handler.

  3. Posted April 1, 2010 at 8:18 am | Permalink

    That’s a cool one, because the WindowedApplication and Application tend to have quite a lot of attributes and namespaces, which makes them hard to read…
    Nice to have these tags around!

  4. Miha
    Posted April 1, 2010 at 8:51 am | Permalink

    Using this technique you just showed you’re basically not really checking if the user is online but just checking whether an URL is reachable. I’ve been confused by how occasionally my Acrobat.com air application tells me “To connect to the Internet” upon startup, while I was connected to the internet (browsing, everything else worked normally). If they use the same technique you just showed it could mean that just the acrobat.com servers were offline (or not reachable for some other reason) and should’ve displayed a more appropriate message that “Connect to the Internet”. Is there no AIR api that hooks into the OS broadcast for internet avaibility (windows 7 does a pretty good job figuring out that for itself, surerly it sends some kind of message when internet is avaible or not) ?

  5. Posted April 1, 2010 at 9:00 am | Permalink

    @Miha

    All the the OS is doing is checking some URL that it believes should always be available. So in your app you could certainly check http://www.google.com or something that should almost always be available. However most applications rely on services on a specific host – like the Acrobat.com AIR app relies on http://www.acrobat.com being available. For the app to function in online mode http://www.acrobat.com needs to be available. It doesn’t matter to the app if the problem is that the user is disconnected from Internet or http://www.acrobat.com is down. A better error message in the Acrobat.com AIR app would probably be something like “Can’t connect to http://www.acrobat.com. Either your Internet connection or http://www.acrobat.com is down.” Alternatively if the Acrobat.com AIR app can’t connect to http://www.acrobat.com then it could try to make a connection to http://www.google.com and if that doesn’t work then there is probably a good chance that the user’s Internet connection is down.

    Does that help?

  6. Miha
    Posted April 1, 2010 at 12:39 pm | Permalink

    Agreed, a better error message for the Acrobat.com AIR app would be “Cant connect to the acrobat.com service” than “No internet connection is available” if only acrobat.com is unavailable. But my biggest fear after watching the video was that people would code it like this, although after lookup it now i see it’s unecesarry. The NativeApplication does transmit a “networkChange” event and even the URLMonitor class handles it, by sending StatusEvent when there’s a network change. But by providing a pollInterval of 500 ms you overriden that behaviour and forced a HTTP GET every 500ms, which is the part I don’t like ( imagine every application you have running polling http://www.adobe.com every 500ms would be quite a waste of bandwidth). So my suggestion is not defining a polling rate (just delete that line) and the app still works the same, giving the OS and the AIR runtime the chance to notify you when the network changes because you’re most likely gonna end up writing error handling code for service requests anyhow.

  7. Posted April 2, 2010 at 6:57 am | Permalink

    Thanks for the feedback. That is useful information for people building AIR apps.

  8. Rex
    Posted April 4, 2010 at 11:43 pm | Permalink

    Now, all we need is an AIR framework installer for that Nexus One you keep showing us… :)

  9. Posted April 5, 2010 at 10:44 am | Permalink

    Hey Rex,

    We haven’t announced AIR for the Nexus One. Just Flash Player 10.1. But we have announced AIR for the Droid. No dates have been announced yet.

    -James

  10. Rex
    Posted April 5, 2010 at 2:51 pm | Permalink

    Hi James,
    Motorola just announced Android 2.1 for the Droid today – therefore shouldn’t AIR on the N1 be there too?


    Rex

  11. Posted April 5, 2010 at 2:52 pm | Permalink

    It’s up to the individual handset distributors to decide if they will support AIR or not.

  12. Rex
    Posted April 5, 2010 at 4:16 pm | Permalink

    Seems inconceivable that they wouldn’t when others in the OHA are. Is there more to this story?

  13. Kwame
    Posted April 9, 2010 at 6:40 am | Permalink

    Hello James,
    Thank you for your tutorial. They are very good; But please can you send me the complete code + all jars
    for the tutorial you put on Adobe.com on “Flex 4, Java, Spring, and Hibernate in Flash Builder 4″
    Thank you
    Kwame
    PS: Please what is the mining of the code screen. I was not able to put comment on adobe site

  14. Posted April 12, 2010 at 12:09 pm | Permalink

    @Kwame We are working on updating our Flex + Spring Refcard that will contain everything you need. Stay tuned.

  15. Kwame
    Posted April 14, 2010 at 3:47 am | Permalink

    James,
    Thank you very much for your kindness.
    Please, can you email me when it will be ready? also if you will have time,
    why not include in the next post on Refcard an explanation about how to resolve
    the famous “hibernate-lazy-loading” problem may be with dphibernate.
    Really, it will make us happy.
    best regard,
    Kwame.

  16. Kwame
    Posted April 22, 2010 at 1:03 am | Permalink

    Hi, James
    When approximately do you think the new Flex + Spring Refcard will be ready?
    Kwame

  17. Posted April 22, 2010 at 2:00 am | Permalink

    @Kwame Hopefully in the next few weeks.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Subscribe without commenting