BlackBerry
Skip Top Navigation
Developers Partners
North America [change region] Products Solutions Purchasing Support
Developers


Creating a User Interface

Exercise

Write an application for the BlackBerry® device that uses BlackBerry user interface (UI) components, such as drop-down lists.

Objectives

  • Discover how to use the IDE.
  • Discover how a BlackBerry application is organized.
  • Discover some of the basics of the BlackBerry user interface APIs.

Setup

  1. Download the file
  2. In the IDE, open the cityinfo.jdw workspace
  3. Open the CityInfo.java source file.

Tasks

  1. In the CityInfoScreen constructor, add code to display a drop-down list with the following options: “Los Angeles”, “Chicago,” and “NewYork.”
  2. Add a More Info menu item that displays the InfoScreen.
  3. In the InfoScreen inner class, add code to display fields for population, state, and sight-seeing information.
  4. Add code to display information depending on the city that the user selected. (Tip: use the select variable that has already been defined).

Check Your Work

Download the completed code

Review

In this exercise, you discovered the following things:

  • how to use an ObjectChoiceField to create a drop-down list
  • how to create custom menu items
  • how to add text to fields depending on a user selection


Additional Labs

Go to the Next Exercise in “The Basics of Developing for BlackBerry”, Localizing an Application

Back to the Developer Lab Main Menu

 
Other Resources
 
     
 Home | Products | Solutions | Purchasing | Support | Developers | Worldwide | News | About Us | Contact Us | Site Map
 Legal | Copyright © 2008 Research In Motion Limited, unless otherwise noted.