Skip to content
Elvis Chidera

Build J2ME apps with a J2ME phone - From the archive

J2ME, Java2 min read

I will show you how to use this app on your java or Symbian phone to create an app.

First, download the J2ME SDK MOBILE from www.mumey.wen.ru. Open the app and click on New Project. Enter HelloWorld as the Project Name and select a directory to save the project files by clicking on browse.

Click Create and allow access until you see Source Packages and Resources. Open Source Packages, press Options(left soft key), go down and select Project Properties.

Select Build, select Creating JAR. Change JAD file Name from HelloWorld.jad to HelloWorld_jad and JAR file Name from HelloWorld.jar to HelloWorld_jar.

Go back and press Ok again and allow access.

You would be taken back to Source Packages, press Options(left soft key) again. Select New. Select MIDlet as the File Type, click Next. Change MIDlet Name to HelloWorld and Class Name to HelloWorld (they don't have to be the same), leave MIDlet Icon empty for now then click finish and allow access.

You will be taken to a white background with codes (the editor screen).

Clear every line of code by pressing 5. Copy the codes below into the editor.

HelloWorld.java
1import javax.microedition.midlet.*;
2import javax.microedition.lcdui.*;
3
4public class HelloWorld extends MIDlet {
5
6 public void startApp() {
7 Form f = new Form("My first app");
8 f.append("Hello World");
9 Display.getDisplay(this).setCurrent(f);
10 }
11
12 public void pauseApp() {
13 }
14
15 public void destroyApp(boolean unconditional) {
16 }
17}

Click Save(OK), which takes you back to the editor. Press Menu(right soft key) and click on Build(it has a hammer icon), allow access until the app closes. Open the app again for compiling, allow access until it closes. Open the app again for pre-verifying, allow access as usual until it closes. Open the app the last time for jar-ing, it probably gives you an error like this:

pre-jar: do-jar: JARing:java.io.IOException: Failed to write to file BUILD FAILED.

When you get that message or even if you don't, exit the app and open blueFTP (if you don't have one, search for it on www.skenpomobile.net and download). Go to the Project Folder with blueFTP, go to the build folder, copy manifest.mf and go to preverified folder and create a new folder there named META-INF, and paste the manifest.mf file into the new folder. Go back to the preverified folder and mark HelloWorld.class and META-INF, press Menu(left soft key), and select Compress items(jar). Change JAR name to HelloWorld_jar then press OK and allow access until you get compression completed successfully.

Exit BlueFTP and go to the preverifed folder without any app and rename the file from HelloWorld_jar to HelloWorld.jar. Open the HelloWorld app and you will get a Hello World Message.

Bravo, you just built your first app with J2ME SDK MOBILE.

© 2024 by Elvis Chidera. All rights reserved.