Writing J2ME Application in Linux
If you’re going to create a mobile game application better use j2me.. But if you’re mobile application runs in a background better used symbian c++.
Quick Start for setting up your workspace..
1. Install eclipse in synaptic manager for your IDE. Why choose eclipse? Simple and easy to use.
2. You need to have the Java Development Kit (JDK) and the Sun Java Wireless Toolkit (WTK) installed on your system. Click here for installation tutorial
3. Install JDK Sun Java Standard Edition (SE) Downloads .
4. After setting up all the installers, you can now create a simple Hello World.
Creating a project:
1 Choose File – > New -> Project
2. New Poject window will appear. Select J2ME Midlet suite then click Next. Type the name of your project. Example HelloWorld Select which Device your going to use. Then click Finish.
3. On the project explorer pane, right click the name of your project.Select New – > Package. Type the name of your package.
4. After creating a package, right click it, select New -> File . Type your filename for example “HelloWorld.java”
Type this source code.
Create the file src/HelloWorld.java with the following code:
// Sample adapted from http://developers.sun.com/mobility/midp/articles/wtoolkit/
package com.hello
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class HelloWorld
extends MIDlet
implements CommandListener
{
private Form mMainForm;
public HelloWorld()
{
mMainForm = new Form(“HelloWorld”);
mMainForm.append(new StringItem(null, “Hello, World!”));
mMainForm.addCommand(new Command(“Exit”, Command.EXIT, 0));
mMainForm.setCommandListener(this);
}
public void startApp()
{ Display.getDisplay(this).setCurrent(mMainForm); }
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s)
{ notifyDestroyed(); }
}
5. You can now run your HelloWorld midlet.
6. Creating the jar file. Right click the name of your project . Select J2ME then Create Package..



:D said,
April 30, 2008 at 7:28 am
mam magrurun na po yon sa cell?
carmiemendoza said,
April 30, 2008 at 7:34 am
Yes.. There’s a folder build.. Send the jar and jad file. Jad file is the properties of jar file in your phone using bluetooth..
Alvinator said,
April 30, 2008 at 10:26 am
Wow lupet talaga! Explosive!