Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

J2ME 101, Part 2: Introduction to MIDP's low-level UI

John Muchow, Sr. (John@CoreJ2ME.com), Developer, Independent
John Murchow is the author of Core J2ME Technology and MIDP (Prentice Hall, 2002) and is a freelance technical writer and developer. Visit Core J2ME for additional source code, articles, and developer resources.

Summary:  This is the second installment of a comprehensive four-part introduction to Java™ 2 Micro Edition (J2ME) and the Mobile Information Device Profile (MIDP). The series will consist of two tutorials and two companion articles. In this second tutorial, you will learn about the most important components of MIDP's low-level interface. You'll walk through the basics of creating and working with the Canvas and Graphics classes and build a MIDlet. The tutorial will conclude with a brief overview of the Game API, introduced with MIDP 2.0.

Date:  17 Dec 2003
Level:  Introductory PDF:  A4 and Letter (829 KB | 48 pages)Get Adobe® Reader®

Activity:  10191 views
Comments:  

Getting started

What is this tutorial about?

This is the second installment in a four-part comprehensive introduction -- two tutorials and two articles -- to Java 2 Micro Edition (J2ME) and the Mobile Information Device Profile (MIDP). The first tutorial (see Resources) served as an introduction to MIDP, with particular attention to the components that comprise MIDP's high-level interface. We also discussed event-handling techniques on the high-level API and walked through a series of exercises designed to teach you, hands-on, about developing applications on the J2ME platform.

In this second tutorial, you will learn about the most important components of MIDP's low-level interface. We'll discuss the basics of creating and working with the Canvas and Graphics classes. The Canvas class is the backdrop of the low-level API, used to create and define the display area for your application. The Graphics class lets you draw shapes and images on the display area, or screen, as well as select different fonts for your text display. As with Part 1, we'll introduce each component and then build a MIDlet to demonstrate its capabilities. The tutorial will conclude with a brief overview of the Game API, which was introduced with MIDP 2.0.

Portions of this tutorial are used with permission from the book Core J2ME Technology and MIDP by John W. Muchow, published by Sun Microsystems Press and Prentice Hall.


Should I take this tutorial?

This tutorial is intended for experienced Java programmers who would like to learn how to develop mobile applications using J2ME. The code examples are not particularly complex, but it is assumed that you understand how classes are created, inherited, and instantiated within the Java platform. You will also benefit from a working knowledge of using and creating Java Archive Files (JARs). See Resources for more information on using JARs.


Software and installation requirements

To complete this tutorial you will need to install JDK version 1.4 or greater, along with the J2ME Wireless Toolkit (WTK). The WTK download contains an IDE for creating Java applications, commonly called MIDlets, as well as the libraries required for creating them.

The WTK is contained within a single executable file. Run this file to begin the installation. It is recommended that you use the default installation directory. If you choose another directory, make sure that the path you select does not include any spaces.

1 of 8 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Java technology
ArticleID=131728
TutorialTitle=J2ME 101, Part 2: Introduction to MIDP's low-level UI
publish-date=12172003
author1-email=John@CoreJ2ME.com
author1-email-cc=jaloi@us.ibm.com

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).