BlackBerry Development Fundamentals

What people have said about the book:

"What really amazed me about this book was that I learned quite a few things I never knew about the BlackBerry platform and I am not even a developer. Wargo does a brilliant job of explaining the whole infrastructure behind the BlackBerry ranging from BIS to BES to MDS to Push Services to all the different BlackBerry browsers."

Ronen Halevy
www.berryreview.com

 

Home Inside the Book Sample Code Chapter 11 - Hello World Application
Chapter 11 - Hello World Application PDF Print E-mail

The HelloWorld.java application is the starting point for any Java developer. Chapter 11 contains the BlackBerry version of this standard application:

package com.bbdevfundamentals.helloworld;

import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;

//Create the HelloWorld class
public class HelloWorld extends UiApplication {

 public static void main(String[] args) {
 // Instantiate the HelloWorld object
 HelloWorld hw = new HelloWorld();
 // Enter the Event Dispatcher
 hw.enterEventDispatcher();
 }

 public HelloWorld() {
 // Create the HelloWorldScreen and open it
 pushScreen(new HelloWorldScreen());        
 }
}

final class HelloWorldScreen extends MainScreen {
 public HelloWorldScreen() {
 super();
 // Create the screen's title
 LabelField lblTitle = new LabelField(
 "BlackBerry Development Fundamentals", LabelField.ELLIPSIS
 | LabelField.USE_ALL_WIDTH);
 setTitle(lblTitle);
 // add the text to the screen
 add(new LabelField("Hello readers!"));
 }
}

Attachments:
Download this file (HelloWorld.zip)HelloWorld.zip1 Kb26/10/09 08:59
 
InformIT (Pearson Education)