How to Use SQLite to Store Database Records in Offline Applications

Description

SQLite can be used in Cordova applications to store a large number of records, including images, on mobile devices.

Discussion

In a Cordova application, you can use SQLite to store a large amount of information that can be accessed offline on a device. Data stored in a SQLite database can include images.

In the video below, we show how to create a SQLite database on a mobile device. The database is created on the Alpha Anywhere server and then pulled down to the device. Once the SQLite database is populated on the device, a SQL query can be executed against the database to populate a List control.

Google Play Store Warning: If you are building for Android and publishing to the Google Play Store, you must use the SQLiteStorage (cordova-sqlite-storage) plugin in the Cordova App Builder. Other SQLite plugins contain native libraries that are not aligned for Android 15's 16KB memory page sizes and will result in a warning or rejection from Google Play. For more information, see SQLite Databases.

Click here to download the component shown in the videos above.

See Also