How to Start your first application in Java ME
Article Metadata
This article explains how to create and deploy a simple HelloWorld MIDlet by using Carbide.J IDE. These steps are easily adaptable to any other IDE you're using for Java ME development.
Note: As explained in Carbide.j page, Carbide.j was discontinued in 2007.
Contents |
Step 1. Create an empty MIDP project
Click File --> New Project --> MIDP project --> Write your project name ex:"Hello World" --> select your target device SDK (ex:"S60 emulator") --> Finish
Step 2. Create a new empty class
From project menu, select New --> Class --> specify the class name "HelloWorld"
Step 3. Write source code
Copy this code to the HelloWorld class file:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
public class HelloWorld extends MIDlet{
Display display=null;
Form form=null;
public HelloWorld(){
display=Display.getDisplay(this);//get the display controller
form=new Form("Hello World");//get Form instance
form.append("this is my first application");
}
public void startApp(){
display.setCurrent(form);
}
public void destroyApp(boolean arg){
display=null;
form=null;
}
public void pauseApp(){}
}
Step 4. Build and deploy
By using Carbide.j you can now Create your Jar file and deploy it to your device and have fun
Related resources
Wiki article on Nokia Developer Wiki about Carbide.j.


(no comments yet)