WELCOME – RICH INTERNET
Over past few years web has become an important element of day to day life. Advertising a product or fastest mode of exchanging information or building social communities etc are the few examples we all know which couldn’t have been possible without web. While the importance of web has increased over the years, so the supporting technology has undergone various evaluations. Industry has always come up with new innovations to make experience of using web more appealing. The early days of Internet was using just HTML, Scripting languages and Images to present the information, the past few years has brought many new concepts like Animations, AJAX etc. What next, web got its new version Web 2.0 and has changed the definition for what web is used for. More and more sites are built today to ease the process of accessing information and making it more presentable.
After invention of AJAX, a need was felt to have access to information without need to stay connected to internet. Users felt the need of installing web application in local system rather than accessing it online every time they need to get some information. Well to address this concern the biggies came with various solutions like Google Gears, Adobe AIR, Yahoo Browser Plus. (Oh yes, Microsoft Silverlight too provide offline web application access – the support is recently announced on 18th Mar 2009 in Silverlight beta version 3.0)
The purpose of this article is to give sneak preview Adobe AIR and its features. We will look at how it can be installed and also develop basic application to get acquainted with its APIs.
ADOBE AIR – BABY STEPS
Before starting with sample applications lets see what we need to ride on AIR
- Download Adobe AIR SDK from http://www.adobe.com/go/getairsdk
- Download Adobe AIR runtime from http://www.adobe.com/go/getair
- Any Text Editor to write sample application. (I like EditPlus)
Install runtime by double clicking on AdobeAIRInstaller.exe and follow the steps of wizard. AIR SDK is a zip file and doesn’t have installer. Just extract zip file to desired location.
Once SDK zip file is extracted, configure the bin folder of SDK in PATH environment variable of your system.
You can get this dialog box by accessing MY Computer > Properties > Advanced > Environment Variables > Locate PATH variable and click Edit button. (In above screenshot Flex SDK path is displayed, which has nothing to do with Adobe AIR.)
That’s all for to get started with Sample Application. (You can even use Adobe Flex Builder 3 which has built-in Adobe AIR support. There is difference between Flex builder and Flex SDK. Flex SDK provides core libraries to build Flex application, while Flex Builder is an IDE to ease the development by providing GUI for building Flex applications.)
Open your favourite Text editor and create following XML file.
com.adobe.demo.MyFirstAirApp AIR application 1.0 First App First AIR Application First Application index.html standard false true 400 200
This file defines configuration details for your application.
|1||id||A unique identifier for application.||Any|
|2||name||Give meaningful name.||Any|
|3||version||Version of your application.||Any number|
|5||description||Description for your application.||Any|
|6||initialWindow||Defines configuration for First Page to be displayedfor application.|
|7||title||Text to be displayed in Title Bar.||Any|
|8||content||Name of html file.||Any|
|9||systemChrome||Whether to use system display.||standard OR none|
|10||transparent||Whether application window background should be transparent.||true OR false|
|11||visible||Whether application window should be visible.||true OR false|
|12||width||Width of application window.||Any number|
|13||height||Height of application window.||Any number|
Save above file with name as application-config.xml. (You can name it anything.)
Let’s start creating sample application. Create an HTML file in your favourite editor, with below given details.
Save above file as index.html
To run this application you have to ways
- Create an installable version of above file. Then install the application and run it like any other desktop application.
- In development phase since your application undergoes many changes it’s always useful to somehow test application without first installing it. This would save lot of your time before you will actually mark it as final product ready to deploy. AIR SDK bin directory contains a file “adl”, which just helps you to do the same.
Open command prompt and locate the directory where you have saved both the files. Remember both the files must be in same directory.
Enter command as shown in above.
You must get following window.
If you have configured Environment variable you must see above screen without any errors. This is not an ordinary browser page wherein you can right click and get source of application. The page source is protected and user cannot view it by any means.
Enter your name and click “Greet Me!” button. You must get alert window with Greeting message.
BEHIND THE SCENE
Adobe AIR uses WebKit – an open source implementation for HTML engine (Used within most popular browsers – Safari etc). In AIR, applications can be developed using combination of
Also if client machine has Acrobat version 8 or higher, AIR application can leverage all the features of Acrobat reader.
With AIR, Adobe is taking one more step towards building Desktop based application using traditional/modern web technologies. Unlike traditional web application, there is one major difference between browser and desktop based application. Applications running under browser are constrained by the sandbox under which they are executed and hence cannot utilise all the features (e.g. Access to User File System).
Desktop based applications have full access to AIR api’s and such application do not require live connectivity to the server from which they are downloaded. Users can use the application, fee the information to application and it will be later uploaded to actual server when user decides to go online. AIR also provides API to connect to database to embedded SQLite database.
AIR applications are more suitable where user want to have access to information without need to stay connected to internet. AIR is not meant for the applications that require real time data to be fetched and displayed to user (e.g. stock ticker, weather information etc). While AIR has been almost more than year old, recent release of Silverlight may be a tough competitor for AIR.
Applications developed with AIR are considered as fat clients due to the runtime requirements to run the applications. AIR applications cannot be run through browser and require special runtime environment to be installed on client machine. Since AIR is a new technology, it’s hard to bet on the number of AIR runtime installations across the world.
Following links will help you to ride on Adobe AIR.
Following list contains location of various sites which demonstrate applications developed with Adobe AIR