WHAT'S IN THIS CHAPTER?
Opening a database connection
Selecting records from the database
Inserting or updating records
Although you can use XML or binary files to store application or user data, you also can make full use of relational SQL databases right inside your Android and iOS applications. This chapter introduces you to working with local relational databases in your Android and iOS apps.
All operations you perform on the database are not done with AS3, but SQL (Structured Query Language), which is the standard query and data management language for relational databases. Using SQL, you can create tables, perform queries, and insert or modify records.
One component of the underlying Adobe Integrated Runtime (AIR) engine that is part of AIR for Android run time and compiled into Flash-based iOS apps is SQLite, a SQL relational database engine. As a result, you can use the SQL database library API that is part of AIR to work with a local database in your mobile application.
SQLite is a lightweight open-source database engine that stores relational database data in a local file (often with a
.db extension) that you can specify. (For more information on SQLite, go to
For example, using SQLite, you can create database-oriented apps that run offline and sync with a back-end server periodically when the user is connected to the Internet. You may also want to use the database as an alternative to ...