O'Reilly logo

Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android by Michael Eierman, Jakob Iversen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Database

The three classes, Contact, ContactDBHelper, and ContactDataSource, are used in the ContactActivity class to implement the saving of contact data to the database. This will require implementing several new methods and modifying some existing methods. Because the methods to retrieve contacts have not been implemented yet, the update functionality will be only partially implemented at this time.

The first step is to provide an association between the ContactActivity class and a Contact object. This is implemented by declaring a private variable in the ContactActivity class. Enter the following code after the class declaration and before the onCreate method:

private Contact currentContact;

Next associate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required