http://www.developer.com/lang/article.php/3734746/Building-Desktop-Applications-For-The-Web-With-Adobe-Integrated-Runtime.htm
People are building desktop applications for the web that are unlike any web-based application anyone has ever seen before. Just about everyone with a web connection has experienced Adobe Flash content/applications. But, Adobe's Flash is not a "web technology" by any stretch of one's imagination—the fact that the Flash player is installed on most people's systems and thus Flash content can be played within the browser is the reason why Flash is wrongly assumed to be a web technology. The browser's presence in rendering Flash content/applications is entirely incidental. But, what if your users want to run your "connected" application offline? Or, what if they want access to their local file system, a feature that browser applications typically don't allow because of security restrictions? Adobe has launched a new environment, Adobe Integrated Runtime (AIR), an extra layer of software that allows the same program to run on different operating systems and hardware (Java is another example). AIR allows applications to be installed on the local operating system and accessed from the desktop just like the other applications that the desktop user runs. At the same time, AIR applications can access online information. That is, these rich applications can run either online or offline, when appropriate or necessary. One example is eBay Desktop, which allows sellers to complete a listing offline and then upload it to eBay when they are connected to the Internet. AIR version 1.0 was released on February 25, 2008. AIR is not a general desktop runtime that competes with lower-level application runtimes. It comes from the web to the desktop and is aimed at web developers. Its primary use is to enable web applications and Rich Internet Applications (RIAs) to be deployed to the desktop. Figure 1 illustrates the overall AIR system architecture that enables robust and feature-rich applications to run on the desktop (Windows, Mac, and Linux—in the near future), the web, or both. Figure 1: Adobe AIR application stack—simplified view The references at the end of this article provide a good deal of additional information on terms such as Flex, AJAX, and the like used in Figure 1, for those not already familiar with them. AIR applications run with the same user privileges as native applications. In general, these privileges allow for broad access to operating system capabilities such as reading and writing files, drawing to the screen, communicating with the network, and so forth. And, operating system restrictions that apply to native applications, such as user-specific privileges, equally apply to AIR applications. Today's users don't have to seek out AIR to enjoy its benefits; they are prompted to download it along with the first AIR applications they want to use. My guess is that future versions of the ubiquitous Flash player will be bundled with AIR. Google Analytics, a web traffic analytics service, is a prototypical AIR application. It is extremely comprehensive, quick-to-setup, easy-to-use, and totally free. It's a powerful tool that can help you better understand your traffic/visitors, measure performance of individual pages (or even ad units), identify low performing web pages, and more. Note: If your web site receives fewer than 50-100 K pageviews/monthly, any simpler analytics tool should be sufficient as well. Google now officially supports the development of the Google Analytics AIR application built by Nicolas Lierman at Boulevart. They are in close contact with the Google Analytics team to make sure the AIR app has all the latest and upcoming Analytics features present. Google will also host the app on the Google domain once it is released. The release of Google Analytics AIR is currently slated for mid 2008. Figure 2: Google Analytics running on the Mac Adobe AIR is a cross-operating system runtime that allows developers to leverage their existing web development skills in HTML, Ajax, XML, Flash, and Flex to build and deploy rich Internet applications to the desktop. Although these applications may be based upon web technologies, it is important to keep in mind that the end result is a desktop application, and as such the primary security model for AIR is that of a desktop application, rather than a web application. A desktop application has certain characteristics. On the one hand, desktop applications generally have a lot more privileges than a similar web application because they have been installed by the user to a specific desktop machine, implying a degree of trust that is greater than that of arbitrary web content. On the other hand, the privileges inherent in a desktop application require a greater degree of caution as certain coding practices and patterns that may be common in web applications may never be acceptable in a desktop application. Being a desktop application runtime, the AIR security model is significantly different from the web browser security model. The application sandbox in AIR provides direct access to system APIs, but in return a number of APIs have been restricted or outright prohibited. Specifically, importing of non-application (that is, not loaded via app:/) content and dynamic generation of code within the application sandbox is heavily restricted. And, AIR applications are written using either compiled bytecode (SWF content) or interpreted script (JavaScript, HTML) so that memory management is provided by the runtime. This minimizes the chances of AIR applications being affected by vulnerabilities related to memory management, such as buffer overflows and memory corruption. The following links provide a good deal of additional information on AIR security, which is beyond the scope of this article. AIR applications can be developed using one or a combination of the following technologies: As a result, AIR applications can be: Thus, AIR can helps developers use existing software development skills to create and distribute Internet-enabled desktop applications. Adobe currently provides three ways of developing AIR applications: Flash CS3 Professional does not ship with any AIR functionality out of the box, but Adobe recently released a free update to enable the development and compiling of AIR applications directly from within the Flash CS3 authoring environment. This update, officially called Adobe AIR Update for Flash CS3 Professional, is available on both Mac and Windows and is very easy to install. When you download and install the update, you will notice that there is a new Adobe AIR option in the Create New section of the welcome screen, as shown in Figure 3. After creating a new Adobe AIR project, you will notice that the Flash authoring tool looks exactly like it normally does when creating Flash files. This is because you will be building your applications pretty much the same way that you do for web-based Flash projects. Figure 3: New AIR option in the Create New section of the welcome screen of Flash The cross-platform nature of the runtime means any HTML editor, coupled with the AIR SDK, can create AIR applications. AIR itself uses the WebKit HTML rendering engine, which is wrapped around Flash and PDF technologies. HTML and Ajax developers have the choice of working with the command line tools provided in the Adobe AIR SDK or using a full IDE, Flex Builder 3 (shown in Figures 4 and 5), with support for Adobe AIR. Figure 4: Create an AIR application with Flex Builder 3 Figure 5: Flex Builder 3—a feature-rich IDE Finally, like Flash CS3, Dreamweaver CS3 requires an additional extension to compile AIR applications, in the form of an update. The AIR extension for Dreamweaver will allow you to package and preview AIR application files directly within Adobe Dreamweaver CS3. A selection of "showcase" applications (available at www.adobe.com/products/air/showcase/) based on Adobe AIR is cited in Figure 6. Typically, they can run on desktops or laptop computers and are not dependent on a constant Internet connection. But, there's a lot more to some of them. Figure 6: Selected AIR applications To further illustrate the Adobe Integrated Runtime environment, here I'll mention Buzzword, an innovative new word processing and collaboration application soon to be deployed with AIR. Buzzword offers an excellent example of a true Rich Internet Application and is available free for public use at www.buzzword.com. Figure 7 shows a screenshot of the present (web) version this new word processor. The Adobe development team is currently working on an AIR version of Buzzword to work either on-line or off-line—with all your Buzzword files. They've shown this capability at some Adobe presentations, but there is still more work to be done to fully support AIR. Buzzword is a web application today, which means you need to be connected to the Internet to use it. With Buzzword, your files are all saved on the secure Buzzword servers. This provides the convenience of having access to your files wherever you have an Internet connection. And, there is no need to email documents to colleagues for review or collaboration; just share them via Buzzword. Figure 7: Buzzword (the web version) There are some great Buzzword features. One is real, working what-you-see-is-what-you-get (WYSIWYG) document formatting: people can actually view, edit, and then print a document from the web without affecting its formatting. Contrast this with Google Docs and most other online word processors, where text appears differently across web browsers and computer screens—which leads to confusion about how final drafts will appear in print. Buzzword also features in-line notes, where users can leave notes for each other in reference to particular sections of text. Whether or not Buzzword will be attractive enough to get Microsoft Office users to switch over in great numbers is questionable: The program may end up joining so many other "lite" word processors of the past in the digital dustbin. However, the attractiveness of online document collaboration has not escaped Microsoft, who recently announced its Office Live Workspace as a way of offering online collaboration while still requiring users to hang on to Microsoft Office. With Buzzword, Adobe gets to bolster its own PDF-centered document workflow, as well as promoting its own development frameworks for the next-generation of Web-based applications. Built on Adobe's Flex development platform (which takes advantage of the ubiquitous Flash player), Buzzword's fonts and typography easily match the fidelity of Microsoft Word. And, Buzzword is integrated with a new Adobe service called Adobe Share. This is a file-sharing app that is geared towards document sharing. You get one gigabyte of storage free and you can embed a Flash preview of your documents into any web page, from which anyone can download and print a PDF. With Share you can: Figure 8: Assigning a [possibly different] role to the other [distributed] users with whom you share a document. Because RIAs improve the way people find and manipulate content, complete transactions, and consume multimedia content, these technologies are ideal for improving the user experience for information workers. Moving forward, RIA technologies such as Adobe Flash and Flex, Adobe Integrated Runtime (AIR), Ajax, the Curl RIA Platform, Laszlo Systems OpenLaszlo and Webtop, Microsoft Silverlight, Nexaweb's Enterprise Web 2.0 Suite, Oracle WebCenter, and Sun JavaFX will be used to augment or may even replace traditional enterprise portals and Microsoft Office as Information Workplaces front ends. Marcia Gulesian is an IT strategist, hands-on practitioner, and advocate for business-driven architectures. She has served as software developer, project manager, CTO, and CIO. Marcia is author of well more than 100 feature articles on IT, its economics, and its management.
Building Desktop Applications For The Web With Adobe Integrated Runtime
March 18, 2008

Click here for a larger image.
Note: Flex is a GUI toolkit library that sits on top of the Flash library and runtime. The output of a Flex build is simply a SWF file (the type of file that the Flash player will run; it ends up being just another Flash application. The Flex SDK is free and open sourced; you can write Flex applications, compile them, and ship them all for free.
Note: AJAX (Asynchronous JavaScript and XML) is a group of inter-related web development techniques used to create interactive web applications. A primary characteristic is the increased responsiveness and interactivity of web pages achieved by exchanging small amounts of data with the server "behind the scenes" so that entire web pages do not have to be reloaded each time there is a need to fetch data from the server.
Google Analytics

Click here for a larger image.
AIR Security Model
Development Environments
Using Flash CS3 Professional for Adobe AIR development

Using other tools for Adobe AIR development

Click here for a larger image.

Click here for a larger image.
Showcase Applications

Click here for a larger image.
Adobe Buzzword

Click here for a larger image.

Click here for a larger image.
Note: Google has recently parried AIR's offline option with Google Gears, which allows Web applications to be taken offline, similar to Buzzword.
Conclusion
References
About the Author