MotoDev Studio is a new IDE platform to develop J2ME applications for Motorola phones.
I just did a basic test using this.
Prerequiresites:
- Install latest JDK SE
- Install MotoDevStudio
Build Steps:
- Launch MOTODEV Studio for Java(TM) ME v1.0
- Create a new project
- Select Phone type
- Create a package under src folder. (not necessary, but a good practice. else default package will be selected)
- Create class
- Add code (simple hello world using LCDUI)
package MyPackage;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class HelloWorld extends MIDlet
{
private Form mainScreen;private Display myDisplay;
public HelloWorld()
{
myDisplay = Display.getDisplay(this);mainScreen = new Form("Hello World");
StringItem strItem = new StringItem("Hello","This is a J2ME MIDlet.");
mainScreen.append(strItem);
}
/**
* Start the MIDlet
*/
public void startApp() throws MIDletStateChangeException
{
myDisplay.setCurrent(mainScreen);
}/**
* Pause the MIDlet
*/
public void pauseApp()
{}
/**
* Called by the framework before the application is unloaded
*/
public void destroyApp(boolean unconditional)
{}
} - Edit Jad file MyMidlet.Jad; Goto Midlets tab (below); Add Midlets e:g MidletName,icon,Package.Class
- Build project, default setting is autobuild
- Create Package;Rightclick on MyMidlet Project (root element), From pulldown menu click J2ME and click on select CretePackage
- If everything goes well you should have MyMidlet.jar and MyMidlet.Jad files in ~:\Documents and Settings\user\workspace\MyMidlet\deployed
- Use MidletManager or your favourite tool to install this midlet
- Restart phone and test midlet
Note: This is without signing
No comments:
Post a Comment