This app consists of five classes:
• Class MainActivity
(Section 8.5) manages the app’s fragments and coordinates the interactions between them.
• Class ContactListFragment
(Section 8.6) is a subclass of ListFragment
that displays the contacts’ names and provides a menu item for adding a new contact.
• Class AddEditFragment
(Section 8.7) is a subclass of Fragment
that provides a GUI for adding a new contact or editing an existing one.
• Class DetailsFragment
(Section 8.8) is a subclass of Fragment
that displays one contact’s data and provides menu items for editing and deleting that contact.
• Class DatabaseConnector
(Section 8.9) is a subclass of Object that manages this app’s interactions with a SQLite database.
Class MainActivity
is created by the IDE when you create your project. As you’ve done in prior projects, you must add the other classes to the project’s com.deitel.addressbook
package in the src
folder. To do so for each class, right click the package and select New > Class, then specify the class’s name and superclass.