Thursday, December 02, 2010

Video Article - Comparing AIR for Android Development Processes

Yesterday I made a post about my experiences with the new Flash Builder 4.5 and 4.1 IDEs while developing mobile applications. Today, we follow this up with a video to illustrate some of the key points you'll need to get started.



Flash Builder 4.5 download

FileBrowser.fxp (Flash Builder 4.01/AIR 2.5 SDK project - 76 kb)
FileBrowser.apk (Android Package - 1.02 MB)
Installed application size = 1.02 MB (without graphics, icons, splash images etc)

MobileFileBrowser.fxp (Flash Builder 4.5 project - 840 kb)
MobileFileBrowser.apk (Android Package -1.78 MB)
Installed application size = 768 kb (with graphics, icons, splash images etc)

Have fun!

Wednesday, December 01, 2010

Mobile Development with Flash Builder (Tutorial and Source Code)


Today I am releasing a set of two applications, one built using the Flex 4.1 SDK and one built using the Flex 4.5 SDK (Burrito version of Flash Builder using the "Hero" framework).  Although the base application is essentially the same, the differences are astounding in terms of development ease and performance. 

The project itself is a simple project to demonstrate how to read/write to a file system.  The application is named LetMeC (“let me see”).   The screenshot below is of the application built using Flash Builder 4.01 overlaid with the AIR 2.5 SDK.  This one uses the FileSystemDataGrid component and has several helper classes.  The source code for the AIR 2.5 project is available here: 

FileBrowser.fxp (Flash Builder 4.01/AIR 2.5 SDK project - 76 kb)
FileBrowser.apk (Android Package - 1.02 MB)
Installed application size = 1.02 MB (without graphics, icons, splash images etc)



This second screenshot (below) is basically the same application written using the Flash Builder 4.5 Burrito preview.  This application is open and you can use it or install it on your device:

MobileFileBrowser.fxp (Flash Builder 4.5 project - 840 kb)
MobileFileBrowser.apk (Android Package -1.78 MB)
Installed application size = 768 kb (with graphics, icons, splash images etc)



Note that the installed sizes of the applications vary.  The first one is larger even though I never used any graphics for icons, splash screens or other bits.  The Flash Builder 4.5 Burrito application has a larger installer, however on the Google Nexus 1 disk, the installed application is only 768 kb, of which roughly 398 kb is images alone coupled with 230 kb of icons!  The Hero framework rocks! Here is a screenshot.




The differences in development are vast and I am definitely favoring the direction Adobe is running towards with respect to the Hero framework.  Mobile development in Flash Builder 4.5 is much easier.  For starters, there is a notion of "views" and features such as screen orientation are supported.  The first thing you will notice is that the list of components is greatly reduced.  The version of this I built using 4.1 used the component.  This component by itself is very heavy weight (it is still MX or Halo qualified, not Spark).  The scroll bars are difficult to use as the hit area on a touch screen is very small.  Also the orientation is something you have to do manually if you want your application to resize and reorient when the phone is tilted.

One item that works well on PC, Mac, and Linux is AIR’s “openWithDefaultApplication()” method.  No such luck on Android as the architecture uses a notion of “intents”.   It is easy to write code to access the functionality rather than accessing the notion of a "file".  One line of code will open up an SMS, URL, or even phone someone.  As the code samples from James Ward illustrate below:



Last thoughts?  I am now addicted to mobile development!  Adobe Flash Builder 4.5 rocks (even though it is a preview and somewhat "beta").  The most beautiful thing is that I can use 95% of my code for a desktop application too.

Try it for yourself.  Download the Flash Builder 4.5 preview from http://labs.adobe.com

I will post a video of this whole process very shortly on this blog.

Peace, love and may your code compile on the first try!