Creating and using an SQLite database
In this recipe, we're going to demonstrate working with an SQLite database. If you are already familiar with SQL databases from other platforms, then much of what you know will apply. If you are new to SQLite, take a look at the reference links in the "See also" section as this recipe assumes a basic understanding of database concepts including schemas, tables, cursors, and raw SQL.
To get you up and running with an SQLite database quickly, our example implements the basic CRUD operations. Generally, when creating a database in Android, you create a class that extends SQLiteOpenHelper
, which is where your database functionality is implemented. Here is a list of the functions to provide each of the basic operations: ...
Get Android Application Development Cookbook - Second Edition 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.