The BlackBerry app Hello World

Source: Internet
Author: User

1. Installation of Blackberry_email_mds_4.1.4.exe and Blackberry_simulators_5.0.0.228_9700.exe

2. Install eclipse3.6

3. Install the BlackBerry Java Plug-in for Eclipse v1.1

4. Create a BlackBerry project, File-> New-> project-> BlackBerry-> BlackBerry Project

Project Name:helloworld

Click Finish to complete the project creation

5. Create a new Java class, named HelloWorld, which reads as follows:

Import Net.rim.device.api.ui.Field; Import net.rim.device.api.ui.UiApplication; Import Net.rim.device.api.ui.component.Dialog; Import Net.rim.device.api.ui.component.LabelField; Import Net.rim.device.api.ui.component.RichTextField; Import Net.rim.device.api.ui.container.MainScreen; public class HelloWorld extends UIApplication {public static void main (string[] args) {HelloWorld Theapp = new Helloworl D (); Theapp.entereventdispatcher (); Public HelloWorld () {Pushscreen (New Helloworldscreen ());}} Final class Helloworldscreen extends Mainscreen {helloworldscreen () {super (); LabelField title = new LabelField ("Hello world title", Labelfield.ellipsis | Labelfield.use_all_width); Settitle (title); Add (New Richtextfield ("Hello world!", field.non_focusable)); public void Close () {Dialog.alert ("goodbye!"); Super.close ();}}

6. Run the HelloWorld program in the BlackBerry Simulator

Select the HelloWorld item and right-click-> Run as-> BlackBerry Simulator

Click the menu button in the BlackBerry Simulator window that appears, and then click the Downloads icon, and the icon for the newly created HelloWorld application will appear, and click the HelloWorld icon to run the application. The HelloWorld program is to display a HelloWorld tag in the application window.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.