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

Implementing the core methods

In order to build our content provider, the next step will be to prepare our core database access and data modifying methods, better known as CRUD methods. This is where the core logic of how we want to interact with our data depending on the insert, query, or delete calls received is specified. We will also implement the Android architecture's life cycle methods such as onCreate().

Initializing the provider through the onCreate() method

We create an object of our database manager class in onCreate(). There should be minimum operations in oncreate() as it runs on the Main UI thread, and it may cause lag for some users. It is good practice to avoid long-running tasks in oncreate() as it increases the startup time of ...

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