A (175)

(Tuis.) #1
CHAPTER 14: Android Content Providers: Providing Data to Applications 523

On the right of Figure 14-10, you can see the empty (blank) TableLayout UI layout container, with the
Contact Galaxy Ruler Activity screen label at the top of the app display screen that you defined in
the Android Manifest XML file.


This last thing you need to do here to set up a database to use for your ContactGalaxy Activity
subclass, before you write the Content Provider related Java code. Create some Galaxy Ruler
contact data for your ContactsContract database table by using the Android Contacts utility, which
you will learn how to use in the next section of the chapter.


Once you enter data into your ContactsContract database using the Nexus One AVD emulator, you
will then be able to access the ContactsContract data table, using the Java code that you will be
writing in the ContactGalaxy.java Activity subclass.


Creating Your Galaxy Emperor Contact Database


Now you are ready to add galaxy rulers (I hear Spock is the Emperor of Andromeda) to the Contacts
database. In the Nexus One AVD, click on the Contacts Database icon, shown on the left side of
Figure 14-11, to launch it.


Figure 14-10. Test ContactGalaxy.java Activity subclass menu and TableLayout UI container in the Nexus One

Free download pdf