O'Reilly logo

Android SQLite Essentials by Vikash Kumar Karn, Sunny Kumar Aditya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

General tips and libraries

We will cover some general and not so general workarounds and practices, which can be put to good use depending on the situation. For instance, in some cases, we need to have a prepopulated database of values that we will make use of in our Android application or upgrading a database, which seems trivial but can break our application.

Upgrading a database

In Chapter 2, Connecting the Dots, we used onUpgrade() to show how a database is updated. If we go back to the example, you will notice that it executes a Drop Table command. What will happen here is that the original table will be dropped and a new table will be created by the call, onCreate(). This will lead to a loss of the existing data and hence is not suitable if ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required