Thursday, December 20th, 2007
With all of the press surrounding Adobe AIR, I’m sure many of you have been chomping at the bit to give it a go. Jonathan Snook shows you how in his tutorial, Christmas Is In The AIR. AIR is Adobe’s answer to leveraging existing web technologies for building desktop applications and it’s a cool bit of technology. Jonathan walks you through all of the basic steps of setting up your development environment for the AIR SDK, explaining the file dependencies and discussing AIR’s Sandbox Security model. One of the coolest parts of the tutorial, though, is when he shows how to store data via the AIR API:
Youâ€™ve essentially got 4 different ways that you can store data:
- Using the local database. AIR comes with SQLLite built in. That means you can create tables and insert, update and select data from that database just like on a web server.
- Using the file system. You can also create files on the local machine. You have access to a few folders on the local system such as the documents folder and the desktop.
EcryptedLocalStore. I like using the
EcryptedLocalStorebecause it allows you to easily save key/value pairs and have that information encrypted. All this within just a couple lines of code.
- Sending the data to a remote API. Our to-do list could sync up with Remember the Milk, for example.
To demonstrate some persistence, we’ll use the file system to store our files. In addition, we’ll let the user specify where the file should be saved. This way, we can create multiple to-do lists, keeping them separate and organized.
The application is now broken down into 4 basic tasks:
- Load data from the file system.
- Perform any interface bindings.
- Manage creating and deleting items from the list.
- Save any changes to the list back to the file system.
Posted by Rey Bango at 6:30 am