Chapter 19. Working with Data in AIR

To many Flex developers who are new to AIR, some of its functionality may appear foreign. Because of this, developers will sometimes create applications that don’t take full advantage of the powerful capabilities AIR provides. Prime examples are AIR’s capabilities for storing and working with local data.

The first area of functionality that deals with storing and working with local data is the Encrypted Local Store. This provides secure key/value local storage of binary data. The data can only be accessed by your AIR application.

The second area is the embedded data support with SQLite in AIR. This provides full relational database support directly on the user’s computer. This allows the developer to store and retrieve almost any type of data using SQL queries.

The final area is the local filesystem support. AIR gives you full access to the local filesystem, including the ability to create, delete, copy, and edit files and folders on the user’s computer.

By learning to work with these three key features of the AIR API, you can take full advantage of the power AIR provides.

19.1. Safeguard Files with the Encrypted Local Store

Contributed by Ryan Stewart

Problem

You need to protect entire files inside an AIR application.

Solution

Use the Encrypted Local Store and the file APIs to put a file in a safe and secure location.

Discussion

Most people associate the Encrypted Local Store with storing usernames and passwords or other bits of text. In reality, the Encrypted ...

Get Flex 4 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.