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

Using a content provider

The main reason we built a content provider was to allow other applications to access the complex data store in our database and perform CRUD operations. We will now build one more application in order to test our newly built content provider. The test application is very simple, comprising of only one activity class and one layout file. It has standard buttons to perform actions. Nothing fancy, just the tools for us to test the functionality we just implemented. We will now delve into the TestMainActivity class and look into its implementation:

public class TestMainActivity extends Activity { public final String AUTHORITY = "com.personalcontactmanager.provider"; public final String BASE_PATH = "contacts"; private TextViewqueryT, ...

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