Page 3
OF THE FOLLOWING DAMAGES: DIRECT, CONSEQUENTIAL, EXEMPLARY, INCIDENTAL, INDIRECT, SPECIAL, PUNITIVE, OR AGGRAVATED DAMAGES, DAMAGES FOR LOSS OF PROFITS OR REVENUES, FAILURE TO REALIZE ANY EXPECTED SAVINGS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, LOSS OF BUSINESS OPPORTUNITY, OR CORRUPTION OR LOSS OF DATA, FAILURES TO TRANSMIT OR RECEIVE ANY DATA, PROBLEMS ASSOCIATED WITH ANY APPLICATIONS USED IN CONJUNCTION WITH RIM PRODUCTS OR SERVICES, DOWNTIME COSTS, LOSS OF THE USE OF RIM PRODUCTS OR SERVICES OR ANY PORTION THEREOF OR OF ANY AIRTIME SERVICES, COST OF SUBSTITUTE GOODS, COSTS OF COVER, FACILITIES OR SERVICES, COST OF CAPITAL, OR OTHER SIMILAR PECUNIARY LOSSES,...
Create a screen for the HelloWorld application ..................13 Allow the HelloWorld application display a screen................14 Display a message when a BlackBerry smartphone user closes the HelloWorld application ..14 Test the HelloWorld application in the BlackBerry Smartphone Simulator ........14 Code sample: A HelloWorld application ....................15 Create a BlackBerry device application with advanced UI features............16...
Page 6
Create a menu item that a BlackBerry smartphone user clicks to display more information about a city they select ............................18 Create a menu item that a BlackBerry smartphone user clicks to close a BlackBerry device appli- cation................................19 Add menu items to the CityInfo application menu ................19 Create a screen that displays information about a city..............20...
Device Profile (MIDP) and Connected Limited Device Configuration (CLDC) compliant J2ME environment designed to provide a complete set of APIs and tools for you to develop a BlackBerry device application that runs on BlackBerry smartphones. The BlackBerry Integrated Development Environment, included with the BlackBerry JDE, lets you create a BlackBerry device application using CLDC 1.1 APSI, MIDP 2.0 APIs, and BlackBerry API...
The BlackBerry® Java® Development Environment (JDE) and BlackBerry® Java® Development Environment Plug- In for Eclipse™ include multiple tools that you can use to develop BlackBerry device applications. You can also obtain these tools by downloading the BlackBerry Java Development Environment Component Package..
BlackBerry Enterprise Server. Using the BlackBerry Smartphone Simulator with the BlackBerry MDS simulator enables you to test network, push, and browser applications that are designed for use with a BlackBerry Enterprise Server. If you are testing BlackBerry device applications that require an HTTP connection, you need the BlackBerry Smartphone Simulator and the BlackBerry MDS simulator.
Smartphone Simulator and either a messaging application, such as Microsoft® Outlook®, or POP3 and SMTP servers. You do not require a BlackBerry® Enterprise Server. You can obtain the BlackBerry email server simulator by downloading the BlackBerry® Java® Development Environment, the BlackBerry® Java® Development Environment Plug-In for Eclipse™, or the BlackBerry Email and MDS Services Simulator Package from the...
Create a basic BlackBerry device application In this section, you create a BlackBerry® device application that displays the text ‘Hello World!’ on the BlackBerry smartphone screen. When a BlackBerry smartphone user selects the Close menu item from the menu of the BlackBerry device application , the BlackBerry device application displays a dialog box with the text ‘Goodbye!’.
HelloWorld extends UiApplication 2. Create a constructor for the HelloWorld class. public HelloWorld() { Allow the HelloWorld application start sending and receiving events when the application starts UiApplication class is the base class for all BlackBerry® device applications that provide a UI.
As it pushes screens onto the stack, it draws them on top of any other screens already on the stack. When a BlackBerry device application pops a screen off the stack, it redraws the underlying screens as necessary. Only the screen on the top of the stack receives input events.
4. From the HomeScreen of the BlackBerry® Smartphone Simulator, select and open the HelloWorld . The BlackBerry device application displays the text HelloWorld!. 5. From the FullMenu of the BlackBerry device application, select the Close menu item. The BlackBerry device application displays a dialog with the text Goodbye!.
The following sample code pulls together the tasks in this section into an BlackBerry® device application that displays the text ‘Hello World!’ on the BlackBerry smartphone screen and displays a dialog box with the text ‘Goodbye!’ when the BlackBerry device application closes.
Getting started guide //Add the text "Hello World!" to the screen. add(new RichTextField("Hello World!")); //To display a dialog box to a BlackBerry smartphone user with the text //"Goodbye!" when the BlackBerry smartphone user closes the BlackBerry device application, override the onClose() method.
2: Create a BlackBerry device application with advanced UI features 10. Click OK. Add .java source files to the project for the CityInfo application The .java source file name must match the name of the public class or interface in the file. It must also be located in a folder structure that matches its package name.
API Reference for more information. Create a menu item that a BlackBerry smartphone user clicks to display more information about a city they select When a BlackBerry® smartphone user selects a menu item from the menu of a BlackBerry device application, the run() MenuItem code in the method for the menu item executes.
BlackBerry smartphone user selects from a choiceField drop-down list. Invoking UiApplication.getUiApplication.pushScreen(_infoScreen) lets a BlackBerry device application use an instance of itself to display a screen with information on the city a BlackBerry smartphone user selects from a drop-down list. choiceField...
2. In the first line of the constructor for the inner class, invoke the constructor of the MainScreen class. super(); 3. To display a label with the name of the city the BlackBerry® smartphone user selects, in the constructor for the inner class, create a LabelField LabelField lf = new LabelField();...
Allow the CityInfo application set the values of UI fields with city information > In the constructor for the inner class, use a select clause to control the actions that the BlackBerry® device application performs when a BlackBerry smartphone user selects a city from the menu of the BlackBerry BasicEditField.setText()
Getting started guide Code sample: A BlackBerry device application that displays information on a city the user selects Example: * CityInfo.java * Copyright (C) 2001-2008 Research In Motion Limited. All rights reserved. package com.rim.samples.cityinfo; import net.rim.device.api.ui.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*;...
Page 23
BlackBerry device application. private MenuItem _closeItem = new MenuItem("Close", 200000, 10) { public void run() onClose(); //To add menu items to the menu of the BlackBerry device application, override the makeMenu method. protected void makeMenu( Menu menu, int instance ) menu.add(_viewItem);...
Page 24
BasicEditField sightsField = new BasicEditField("Sights: ", null, 50, Field.READONLY); add(lf); add(new SeparatorField()); add(popField); add(stateField); add(sightsField); //Populate fields with data for the city the BlackBerry smartphone user //selects. The 'select' variable stores the value for the city. if (select == 0) { lf.setText("Los Angeles"); popField.setText("3,694,820"); stateField.setText("California");...
The .cod file that results provides services that are similar to those that obfuscation packages provide in an effort to reduce the size of the .cod file. For example, the BlackBerry Java Development Environment removes the following information from a .cod file:...
Parameter Description port A BlackBerry smartphone PIN if the BlackBerry smartphone connects to a USB port. You must also specify the -usb option. password This paramter specifies the password for the BlackBerry smartphone, if a password for the BlackBerry smartphone is set.
Page 27
.jad file on the BlackBerry javaloader [-u] load .jad file smartphone. For example: javaloader.exe -u load My.jad Javaloader loads the .cod files listed in the .jad file onto the BlackBerry smartphone. Remove a BlackBerry device application .cod file >...
With the BlackBerry® Application Web Loader, you can post your compiled application on a central web site and users can se tup the application by using Internet Explorer on their computers to the visit URL. When BlackBerry smartphone users visit the web page, The BlackBerry Application Web Loader asks them to connect their smartphones to the USB port.
Getting started guide Wireless pull (user-initiated) You can post a compiled applications on a public or private web site, and BlackBerry® smartphone users can download the applications over the wireless network by using the web browser on their BlackBerry smartphones to visit the URL.
Need help?
Do you have a question about the JAVA DEVELOPMENT ENVIRONMENT and is the answer not in the manual?
Questions and answers