So this is my example of creating a J2ME application using the EclipseME plugin.
This example should work on similar Sony Ericsson phones.
Prerequisites
You need to have the following installed before doing anything else:
- JDK 6
- Eclipse 3.2 or above
- A Sony Ericsson phone with a USB or bluetooth connection
- Sony Ericsson PC Suite (this should have come on a cd with your phone too)
Next you will need to install the EclipseME plugin to Eclipse
- Follow the install instructions from here.
- After you have restarted Eclipse ,you will need to configure EclipseME with Eclipse. Follow the instructions from here and in step 4 use the location you noted down above(i.e. C:\SonyEricsson\JavaME_SDK_CLDC\)
Now create a new Midlet class following the instructions from here and replace the template code with this:
package com.randomconsultant.test;
import java.util.Date;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class MyMidlet extends MIDlet {
Alert timeAlert;
public MyMidlet() {
timeAlert = new Alert("Alert!");
timeAlert.setString(new Date().toString());
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void startApp() throws MIDletStateChangeException {
Display.getDisplay(this).setCurrent(timeAlert);
}
}
Now you can run in debug mode in the phones emulator
You should see the date pop up for a moment in the emulator.
Now that we know we have a working app, we can try deploying it onto our phone. You have to create a package that will create a jad and jar file:
The jad and jar file will be dropped into the deployed folder within your project.
Now connect your phone via the usb cable or using bluetooth and copy the jad and jar file to somewhere on your phone.
Disconnect your phone from your pc, and open file manager on your phone ( Menu > Organizer > File Manager on my K850i) and select the jad file you copied over. Click on it and it will ask you where you would like to install the jad file (i.e. in applications or games).
Now your application can be selected from which ever menu you added it to (applications or games) and you will be able to run it!
For all my source code you can download it from here.
Leave a comment if you can't get this working or need a hand.
i tried urer tutorial and transferred those jad and jar files to sony ericsson w700i.But when i run it from games or application i get "invalid application"
ReplyDeletehello
ReplyDeleteplease i need guidance. on a shell to develop a knowledge-based system for an undergraduate course.
thank you
Emma
please help send me a shell to use while building a simple knowledge-based system . new in this field.
ReplyDeletethanks
Emma
I, of course, a newcomer to this blog, but the author does not agree
ReplyDeleteAndroid is an operating system such as mobile devices like smart phones and tablet computers.Android is a Linux base mobile application which is providing very fastest services .This Android Incredible features get good popularity In market.Android has a large community of developers writing applications that extend the functionality of the devices.We are also providing good logic to develop more In this field.
ReplyDelete