CHAPTER 14: Android Content Providers: Providing Data to Applications 529
- Once you have added your permissions, click on the AndroidManifest.xml
tab at the bottom of the editing area and switch into XML editing mode.
Take a look at the two newtags and the parameters
that the Manifest Visual Editor has created for you. Your application now has
“permission” to use this database. See Figure 14-18.
Figure 14-18. Click the bottom AndroidManifest.xml tab to show the XML mark-up for the
Next, you are going to learn about Android’s TableLayout class, so that you can create the
ContactGalaxy UI design.
TableLayout: Creating Tabular UI Designs
The Android TableLayout class is a good layout container ViewGroup subclass to learn about in this
chapter, as databases use a tabular format, and that is what the TableLayout class is optimized
to provide. Even though it is subclassed from the LinearLayout class, as you will soon see, it is
quite similar to the GridLayout container. The TableLayout class is most likely going to be used for
applications that need to create “spreadsheet-like” tables of information. As such, it is a logical fit for
use with databases, and a good UI layout container class to learn about in this chapter.
The TableLayout class is subclassed from the LinearLayout class, which you have already read
about, so you will use this layout container to create a single-column table for the database access
functions. You will use Button UI elements as the widgets inside of the table layout container, so that
users can click on these Button UI elements to be able to invoke changes to the database.
The TableLayout class is a public class that extends LinearLayout, so its class hierarchy is as
follows:
java.lang.Object
android.view.View
android.view.ViewGroup
android.widget.LinearLayout
android.widget.TableLayout