
For example, a table may use a bank account number column as the primary key. This is known in database terminology as the Primary Key. Before delving into the specifics of SQLite in the context of Android development, however, a brief overview of databases and SQL will be covered.Įach database table must contain one or more columns that can be used to identify each row in the table uniquely. This chapter will provide an overview of the SQLite database management system bundled with the Android operating system, together with an outline of the Android SDK classes that are provided to facilitate persistent SQLite based database storage from within an Android application. With the ever-present risk that the Android runtime system will terminate an application component to free up resources, a comprehensive data storage strategy to avoid data loss is a key factor in the design and implementation of any application development strategy. The importance of persistent data storage becomes even more evident when taking into consideration the somewhat transient lifecycle of the typical Android application. The use of databases is an essential aspect of most applications, ranging from applications that are almost entirely data driven, to those that simply need to store small amounts of data such as the prevailing score of a game. Mobile applications that do not need to store at least some amount of persistent data are few and far between. Purchase the fully updated Android Studio Electric Eel Edition of this publication in eBook ($29.99) or Print ($49.99) formatĪndroid Studio Electric Eel Essentials - Java Edition Print and eBook (PDF) editions contain 88 chapters and over 800 pages The very first thing you need to do when you want to use SQLite is create a sub class of SQLiteOpenHelper.You are currently reading the Android Studio 1.x - Android 5 Edition of this book. Now, we’ll go straight to the demo for easier understanding. The basic idea for this case is instead of creating a new database, we copy the exist one to the application’s data folder. So, in this post, I will show you how to use existing SQLite database in Android app.

In reality, we do not only need a database to store data but also need one to read information from.


In my previous post about SQLite, I only post the way to create database when application started.
