Getting Started with J2ME

By: Emiley J. Emailed: 1696 times Printed: 2196 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

A brief introduction of  what is J2ME? is a good place to getting started. As with any other technology J2ME has its own set of toolkits and IDEs.

Sun Java Wireless Toolkit
A free development environment directly from SUN is the Sun Java Wireless toolkit. It is a free IDE which can be downloaded at 

Netbeans mobility pack
If you are more comfortable with Netbeans development, this is another free toolkit which you can use to develop J2ME applications. This is downloadable from

If you are familiar with other Java development tools such as Code Warrior or Borland JBuiler etc, then you can search for an extention for developing J2ME applications using your existing IDEs.

There are other device specific J2ME toolkits provided by the device manufacturers. An important point to note here is that if you are using one of these toolkits such as Motorola's or Nokia's toolkit, is that there is a tradeoff in using these proprietary toolkits.

The advantage of using these proprietary toolkits is they are API rich and have many inbuilt device specific apis that can be used in your J2ME application. Motorola for example provides rich APIs to support their GPS enabled J2ME phones. Nokia's toolkit has many Games APIs to support their Nokia phones.

The disadvantage of using proprietary toolkits is that they are no more portable. But if you are targeting a specific model or make of phones or devices then using these toolkits are the way to go. However, if you are developing a J2ME program targeted towards a wide range of phones and devices then it is best to use the Sun Wireless toolkit.

In addition to these toolkits and manufacturer specific APIs, there are other third party APIs for specific functionalities. For instance, Symbol provides the APIs for its Barcode scanners. A J2ME device when attached to these barcode scanner will have to use this third party API to control it from a J2ME program

J2ME Home | All J2ME Tutorials | Latest J2ME Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.

Bookmark and Share


1. View Comment


View Tutorial          By: yeoh at 2009-04-18 21:32:36
2. View Comment

really good

View Tutorial          By: ammu at 2009-11-04 05:07:14
3. View Comment

really really very good
thanks all
and always forward >>>>>>>

View Tutorial          By: bade3 at 2010-01-01 18:52:15
4. View Comment

i need How to connect with database connection in j2me Apps

View Tutorial          By: Renjit at 2010-01-04 01:54:25
5. View Comment

I need how to connect with database connection in j2me too, but i need this sample with Netbeans 6.7.1 project, thanks

View Tutorial          By: BenGunn at 2010-01-12 03:33:44
6. View Comment

Thank you , It is really good for beginners.

View Tutorial          By: Satish Kumar at 2010-01-18 03:06:49
7. View Comment

good one

View Tutorial          By: yogesh at 2010-07-24 21:18:24
8. View Comment


View Tutorial          By: Amarnath.A at 2011-07-14 00:32:08
9. View Comment

i build j2me application for reading text file.......
it runs on emulator but when i deployed it on device it does not
why this is ....happening.....
my mobile is Nokia 3110C

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class ReadFile extends MIDlet implements CommandListener{
private Display display;
private Form form;
private Command read, exit;
private Alert alert;

public ReadFile(){
display = Display.getDisplay(this);
read = new Command("Read", Command.SCREEN, 1);
exit = new Command("Exit", Command.EXIT, 1);
form = new Form("Read File");

public void startApp(){

public void pauseApp(){}

public void destroyApp(boolean unconditional){

public void commandAction(Command c, Displayable s){
String label = c.getLabel();
if (label.equals("Read")){
String string = null;
try {
string = file();
} catch (UnsupportedEncodingException ex) {
if (string != null){
alert = new Alert("Reading", string, null, null);
display.setCurrent(alert, form);
} else if (label.equals("Exit")){

private String file() throws UnsupportedEncodingException{
InputStream is = getClass().getResourceAsStream("/data/aardvark.txt");
InputStreamReader isr=new InputStreamReader(is,"Unicode");
StringBuffer sb = new StringBuffer();
int chars, i = 0;
while ((chars = != -1){
sb.append((char) chars);
return sb.toString();
}catch (Exception e){}
return null;

View Tutorial          By: ganesh at 2012-10-17 10:34:00
10. View Comment

really nice and perfect ! thnak you very much for J2ME section !

View Tutorial          By: arash at 2013-07-16 10:58:45

Your name (required):

Your email(required, will not be shown to the public):

Your sites URL (optional):

Your comments:

More Tutorials by Emiley J.
Error generating from manifest
ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client
IIS and Tomcat - how to configure to work together
PHP Warning: Unknown(): Unable to load dynamic library '/usr/local/php4/lib/php/extensions/no-debug ......
Adding your own Application icon for your J2ME application (jar file)
Creating Menus in Code using
Traversing all files in a directory using Ruby
Using Proxy to connect to URLs in Ruby
POST a form in Ruby
Reading URL content using Ruby (HTTP)
dRuby client/server mode sample program
Benchmark module in Ruby
encoding and decoding in Ruby using Base64 Module
Module Abbrev in Ruby
Standard Library Packages in Ruby

More Tutorials in J2ME
Code sample to Send SMS from a J2ME application.
Adding your own Application icon for your J2ME application (jar file)
Play a multimedia file in J2ME Program (Audio/Video) using MMAPI
Datagrams in J2ME (UDP Programming sample)
Client Server in J2ME (Socket Programming sample)
Using HttpConnection in J2ME (Retrieve web content from a website to a phone)
Using HTTP vs UDP vs Socket in J2ME
RMSCookieConnector - Using Cookies in J2ME
POST UTF-8 encoded data to the server in J2ME
lists, forms, choices, gauges, text fields, text boxes in J2ME
Using List to create a Menu and Menu items in J2ME
Using alerts and tickers in J2ME
J2ME Canvas sample to show games programming in J2ME
Timer and TimerTask example in J2ME
List of GPRS Access points for all countries

More Latest News
Most Viewed Articles (in J2ME )
Sample Java program shows how to Read a file over a network using J2ME midlet
Image and ImageItem sample program in J2ME
Types of configurations in J2ME
Getting Started with J2ME
What is J2ME?
Download a file over a network in J2ME midlet
How to load J2ME applications to the IDEN handsets
Y.S. Sun Green Building Research Center
'LINK.EXE' is not recognized as an internal or ext
Sample J2ME code that shows various functionality of RMS.
A sample J2ME midlet that shows an example of using a Timer and a TimerTask.
GUI components and menu based J2ME Applications.
Your first J2ME program and a midlet lifecycle explained.
java.lang.SecurityException: MIDP lifecycle does not support system exit.
How to get the CLDC and MIDP version from a J2ME program
Most Emailed Articles (in J2ME)
What is J2ME?
Download a file over a network in J2ME midlet
TextBox sample program in J2ME
Sample program to draw a arc in J2ME
Client Server in J2ME (Socket Programming sample)
'LINK.EXE' is not recognized as an internal or ext
Image and ImageItem sample program in J2ME
Sample program to draw a rectangle in J2ME
RMS Basics in J2ME
Types of configurations in J2ME
Types of Profiles in J2ME
A sample J2ME Auto-resume program.
lists, forms, choices, gauges, text fields, text boxes in J2ME
Using alerts and tickers in J2ME
Datagrams in J2ME (UDP Programming sample)