Revision as of 04:15, 21 July 2007 by hartti (Talk | contribs)

Getting started with Java ME

From Nokia Developer Wiki
Jump to: navigation, search

(This page is very much work in progress, please add more information, link to other relevant pages and edit it to give more complete view of this)

Basically getting your first Java ME application (MIDlet) running on a real device, requires a number of steps. This Wiki page tries to guide through the process. As this is targeted to firsdt time MIDlet developers, some things are simplified, and more detailed information can be found elsewhere


Analyze the situation

Java ME is a limited subset of the standard Java (Java SE) available on the desktop computers. Additionally there are some mobile phone related APIs available. There are a number of limitations you need to keep in mind

  • MIDlets run in a sandbox because of security reasons (there are confirmations when using certain functionalities, like networking or sending SMS messages)
  • There is no JNI (Java Native Interface) so you cannot extend the capabilities of Java ME environment on the phone
  • There is no Swing or AWT classes, MIDlets use their own (simplistic) UI classes
  • The capabilities of the Java ME environment vary widely, meaning that the phones have different set of optional APIs implemented (examples include access to files, access to phonebook, video/audio recording, 3D graphics, etc.)

So first of all, before starting anything else, think if Java ME is the right choice for you or should you try to use Flash Lite for your application (runs both on Series 40 and S60 phones), or should you start using Symbian C++ programming (those apps work on S60 phones). You can find a lot of good information in this Wiki or in the FN Java Discussion Forums. There is also documentation available on Forum Nokia web site, as well at Sun Web site and IBM DeveloperWorks Web site.

Overview of the development process

What tools to use and installing them

Coding and compiling your first MIDlet

Running your MIDlet in the emulator and on real device

Typical pitfalls

Compiling the Java ME code with wrong Java compliance option. The correct compliance is 1.3 or 1.4. Compiling with 5.0 or 6.0 compliance makes it impossible to install the MIDlet

Compiling and packaging the MIDlet for incorrect CLDC or MIDP version. This is especially true when using Sun Wireless Toolkit, which by default builds the MIDlet for MIDP 2.1. However most of the current phones have only MIDP 2.0 available. (Note, that you can install on a phone a MIDlet with lower CLDC/MIDP version than what the phone supports, however you cannot install a MIDlet with higher CLDC/MIDP version on the phone. Check the supported CLDC and MIDP versions on FN device specification pages.)

740 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.