Fabio Entertainment
This is my personal blog, any comment are welcome.


BlackBerry J2ME Development Guide

Finally I am doing J2ME development again. This time I am going to focus on mobile application in BlackBerry hand phone.

BlackBerry hand phone is a bit different from Nokia or Sony Ericsson hand phone, they have their own API where standard J2ME Wireless Toolkit unable to compile. So, I hereby provide a guide to run a simple Hello World application with BlackBerry Java Development Environment (BlackBerry JDE).

I am using BlackBerry JDE v4.6.0, my default emulator is BlackBerry 9000 hand phone.


Open BlackBerry JDE.


Create a workspace name: development.jdw


Create a project name: HelloWorldDemo.jdp


Create a file name: HelloWorldDemo.java

After all the above steps done, I need to manually write a simple Hello World MIDlet. (If you are lazy to do so, you can use NetBeans to generate a sample for you.)

Then, I need to add in the project properties.



It is because by default the project properties are empty.


Build success.

After the code build complete, a HelloWorldDemo.cod file should located at C:\Program Files\Research In Motion\BlackBerry JDE 4.6.0\simulator\ folder, this file is use by the simulator.


Now, I open BlackBerry Device Simulator.


Click on Menu.


Click on Downloads. The HelloWorldDemo application had been installed to this folder on the simulator.


Click on HelloWorldDemo application.


Done.

The tricky part of this BlackBerry JDE is that when I run my program, it won′t immediate open my program. It only install all the COD files into the simulator & show me the default screen, I will need to manually go into the "Downloads" folder to open my program. Quite a weird design. =.=

Other then using BlackBerry JDE, we can use NetBeans or Eclipse plug in as well.

Enjoy the guide.

Tweet This!Share on FriendFeedTechnorati LinksSave to del.icio.usDigg This!Share on Facebook

posted by Fabio | 22/09/2008 15:38:31

2 Comments

Every thing is good.. Please rectify my problem.
The text in the name of main Midlets is visible clearly.. please send me a helloworld program ..
Thanks in Advance

Manoj

posted by Manoj | 10/12/2008 19:16:40

You can generate a simple hello world program using NetBeans easily with new project.

Here is a sample, if you fail to generate any.

package com.fabiolee.mobile.sample;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class HelloWorld extends MIDlet implements CommandListener {
private Display display ;
private TextBox textBox ;
private Command quitCommand;

public void startApp() {
display = Display.getDisplay(this);
quitCommand = new Command("Quit", Command.SCREEN, 1);
textBox = new TextBox("Hello World", "My first MIDlet", 40, 0);
textBox.addCommand(quitCommand);
textBox.setCommandListener(this);
display.setCurrent(textBox);
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}

public void commandAction(Command choice, Displayable displayable) {
if (choice == quitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}

posted by Fabio | 11/12/2008 00:24:34


Post a Comment
* You need to have JavaScript enabled in order to continue.
* Please enter your name, spammer's post will be filter out.
Author:
E-mail:
Website:
Text:
* Adds [url] and [/url] around Internet Addresses.
* [url]http://url[/url] or [url=http://url]URL text[/url].
* Adds [img] and [/img] around Internet Images.
* Images width should less than 500 pixels.
* Adds [code] and [/code] around Programming Code.
* Emoticons
:):(
:)):((
:P:D
;)X(

Contact Me

Last Update : 03/10/2009 03:55:33

LOG IN/OUT

THEME










© Copyright 2004-2010 Fabio Entertainment. All Rights Reserved.
This site is optimised for Internet Explorer 6, Firefox 2 and above.