Namespaces
Variants
Actions
Revision as of 09:36, 19 July 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to Start your first application in Java ME

Jump to: navigation, search
Article Metadata

Article
Created: User:Spider Eg (16 Mar 2007)
Last edited: hamishwillee (19 Jul 2012)

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.png
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.

121 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved