The database mini app

In this section, we will put into practice everything that you have learned so far and create a mini database that enables us to add, delete, search, and select data.

First, let's create a new project with all the settings at their default values and call it Database. The code for this mini app is in the download bundle of the Chapter 23/Database folder.

Implementing the layout

Create the layout by copying and pasting the next block of XML code. There is nothing new or complicated in the code, but be sure to review it to make a mental note of the various id properties on the EditText and Button widgets because it will make understanding the Java code simpler.

Add this XML to the layout_main.xml file:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...

Get Android Programming for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.