Book Image

Android SQLite Essentials

By : Sunny Kumar Aditya, Vikash Kumar Karn
Book Image

Android SQLite Essentials

By: Sunny Kumar Aditya, Vikash Kumar Karn

Overview of this book

<p>SQLite is an open source relational database management system. Android uses the SQLite database to store and retrieve data persistently. The driving force behind the platform is the database, enabling a myriad of choices for developers making cutting-edge applications.</p> <p>Android SQLite Essentials focuses on the core concepts behind building database-driven applications. This book covers the basic and advanced topics with equivalent simplicity and detail, in order to enable readers to quickly grasp and implement the concepts to build an application database.</p> <p>This book takes a hands-on, example-based approach to help readers understand the core topics of SQLite and Android database-driven applications. This book focuses on providing you with latent as well as widespread knowledge about practices and approaches towards development in an easily understandable manner.</p>
Table of Contents (11 chapters)

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, insertT;

public class Columns {
   public final static String TABLE_ROW_ID = "_id";
   public final static String TABLE_ROW_NAME = "contact_name";
   public final static String TABLE_ROW_PHONENUM =

"contact_number";
   public final static...