Introduction to AIR
In this section, we take a look at the major components involved in implementing an AIR application. We introduce the concepts behind AIR, the Ext framework and Aptana Studio, and how the technologies can be combined to create a desktop application.
AIR is a runtime environment developed by Adobe Inc. used to deploy desktop applications using technologies that have, up until now, almost exclusively been used in the development of Web applications. As of this writing, AIR is available on the Microsoft® Windows® and Mac OS X, with an alpha version available for Linux®.
In addition to simply supporting Web development technologies, AIR also provides access to the local file system, allowing applications to store data on the user's computer, rather than on a central database server. AIR can also store data on a remote server via Web services. This support for local and remote storage allows AIR developers to create applications that can work offline, saving data to the local file system, which will then be synchronized and uploaded to a central server when an Internet connection becomes available.
AIR's local storage options include an encrypted local store and a SQLite database, both bundled with AIR. Data can also be stored in a local XML file.
Other advantages AIR has over traditional browser-based Web applications include the ability to run applications in the background and access to the operating system's clipboard and drag-and-drop events. AIR applications can even be minimized to the system tray.
Because of the nature of AIR applications (desktop applications built with Web technologies), they are vulnerable to security attacks, such as SQL Injection and Cross-site Scripting. To try and reduce the threat of dangerous applications being installed, all AIR applications must be signed with a digital certificate. These certificates can be untrusted self-signed or trusted certificates purchased from a certification authority, such as Verisign or Thawte. To protect applications from being hijacked by fake updates, all updates must use the same certificate as previous versions of the application, or the update will fail.
Support for AIR is increasing rapidly. Several large corporations like eBay, AOL, NASDAQ, and Nickelodeon have all developed powerful applications on the platform.
Many of Ext's controls are extended feature-rich versions of standard HTML form controls, such as text fields, text areas, combo boxes, radio buttons, and checkboxes. Others offer functionality that would otherwise be difficult and time-consuming to develop, such as grid controls (which feature inline editing, sorting, pagination, and filtering), progress bars, tabbed panels, drag and drop, and date pickers.
Aptana Studio Community Edition is an open source IDE for Web application development. It is based on the Eclipse IDE and can be installed as a stand-alone package or as an Eclipse plug-in. The stand-alone version of Aptana is available on Windows, Mac OS X, and Linux, and the Eclipse plug-in version can be installed on any system that supports Eclipse.
Aptana can be extended to support technologies that are not available out of the box currently, such as PHP, Ruby on Rails, and, of course, AIR. There's even a plug-in available to help create Web applications for the Apple iPhone.
We will use Aptana to develop the sample application. We have chosen it over alternatives like Adobe Dreamweaver CS3 for a number of reasons, most notably because the Community Edition is available for download free of charge on an open source license and because Aptana has excellent support for Ext and AIR.