|
 |
 |
Exercise
Write a basic application for a BlackBerry® device that displays the message “Hello World!” to users.
Objectives
- Discover how to use the integrated development environment (IDE).
- Discover how a BlackBerry application is organized.
- Discover some of the basics of BlackBerry user interface APIs.
Setup
- Download the file
- In the IDE, open the helloworld.jdw workspace
- Open the helloworld.java source file.
Tasks
- Add code to the main() method to start the application.
- Define a constructor for your application to display HelloWorldScreen.
- Add code to the HelloWorldScreen inner class to set the title for the screen, for example, “HelloWorld Sample”.
- Add code to display the text “Hello World!”
- Add code to the onClose() method to display a dialog box with the text “Goodbye!” when the user closes your application.
Check Your Work
Download the completed code
Review
In this exercise, you discovered the following things:
- how to write, compile, and run applications in the IDE
- how to start an application
- how to create a screen and add a title and text fields to it
- how to define an action when the user closes an application
Additional Labs
Go to the Next Exercise in “The Basics of Developing for BlackBerry”, Creating a user interface
Back to the Developer Lab Main Menu
|
|
|
|