In this article, I will continue to learn about the Windows + eclipse environment configuration and Helloworld in BlackBerry development. I believe that through this article, you will have a deeper understanding of Black Berry development.
Windows + eclipse environment configuration and Helloworld in BlackBerry Development
Company colleague Frank sent a BlackBerry development link some time ago, and he downloaded the plug-in and played with the simulator.
Without looking at the relevant information, I wrote a helloworld according to someone else's environment.
1. Download and decompress Eclipsewww.eclipse.org) My version is 3.4.1
2. download and install the BlackBerry Eclipse plug-in BlackBerry_JDE_PluginFull_1.0.0.67 and the simulator BlackBerry_Simulators_4.5.0.173_8830. You can click the BlackBerry tab on the csdn homepage to download the software as prompted. PS is definitely not an advertisement. The benefits of CSDN are not for me)
3. Select newproject in eclipse after installation to check whether there are BlackBerry engineering options. If so, the Environment configuration is OK. Select to create a new project with the specified name.
4. Add sourcefile,
Enter the following code:
- packagecom.lc.blackberry;
-
- importnet.rim.device.api.ui.UiApplication;
- importnet.rim.device.api.ui.component.Dialog;
- importnet.rim.device.api.ui.component.LabelField;
- importnet.rim.device.api.ui.component.RichTextField;
- importnet.rim.device.api.ui.container.MainScreen;
-
- publicclassHellowordextendsUiApplication{
-
- publicstaticvoidmain(String[]args)
- {
- HellowordtheApp=newHelloword();
- theApp.enterEventDispatcher();
- }
-
- publicHelloword()
- {
- pushScreen(newHelloWorldScreen());
- }
-
- finalclassHelloWorldScreenextendsMainScreen{
- publicHelloWorldScreen(){
- super();
-
- LabelFieldtitle=newLabelField("HelloBlackberrySample",LabelField.ELLIPSIS
-
- |LabelField.USE_ALL_WIDTH);
-
- setTitle(title);
- add(newRichTextField("HelloBlackberry!"));
- }
- publicbooleanonClose(){
- Dialog.alert("Bye-Bye!");
- System.exit(0);
- returntrue;
- }
- }
- }
-
5. Compile and run
The above environment is based on the Java environment variables I have configured, because there are other environments on the machine, I do not know whether this has an impact. The above steps are not confirmed in the official documentation. If you have any problems, please search and solve them by yourself.