Using PIM functions

Lab,PIM Data

Exercise

 

Write an application that adds contacts to the BlackBerry® device address book.

 

Objective

  •  
    • Discover how to create a contact in the handheld address book.

Setup

  1. Open rolodex_1.zip
  2. In the IDE, open the rolodex.jdw workspace
  3. Open the Rolodex.java source file.

Tasks

  1. Add code to the onSave() method to complete the following tasks:
    1. define variables to store the information that the user entered in the UI
    2. verify that the user entered a first and last name
    3. open the handheld address book database
    4. create a new contact with the information that the user entered
    5. save the contact to the address book
    6. reset the UI fields to be empty
  2. Build and run your application in the simulator.
  3. In your application, create and save a contact.
  4. Open the handheld address book and verify that the contact appears.

Check Your Work

 

Check out rolodex_2.zip

 

Review

 

In this exercise, you discovered the following things:

  • how to access the handheld address book database
  • how to create and add a contact