Archive for the 'Java ME Development' Category

Adding a Title Screen to a MIDlet

Monday, September 4th, 2006

In a polished application, you usually want to display a title screen or splash screen before the user sees the main screen of the game or application. In this tutorial, we will build a simple application that demonstrates how to display a title screen.

(more…)

Using RMS to Store Persistent Data

Sunday, July 16th, 2006

There are times when you will want your MIDlet to be able to store data that is persistent across multiple executions of the application. In the context of video games, for example, you may want to save the high scores, or retain the game state so that the player can continue later. In this tutorial, we will look at how to use a component of MIDP called Record Management System, or RMS, as a means of storing persistent application data.

(more…)

Handling Key Events

Wednesday, July 5th, 2006

Java ME supports several input mechanisms. In a previous tutorial, we looked at the high-level commands as a means of accepting input from the user. This time, we will look at low-level key events, which are handled through the keyPressed() and keyReleased() methods. We will also look at how to use these methods in a highly interactive game or application.

(more…)

Using Sprint MIDP 1.0 Extensions

Tuesday, June 27th, 2006

Vendor-specific APIs are useful when you need to take advantage of functionality not available in the core MIDP APIs, and you don’t mind locking your application into a single platform. I happen to have a Sprint cell phone, so we will use this as our vendor-specific example in this tutorial. First, we will learn how to use the Sprint Wireless Toolkit 3.0 platform and emulators in NetBeans IDE. Then, we will then use the Sprint MIDP 1.0 Extensions to create a MIDlet that plays sound on a Sprint PCS cell phone with only MIDP 1.0 support and no MMAPI support.

(more…)

Adding Commands

Sunday, June 18th, 2006

Any MIDlet, in order to be useful, will need to accept some form of input from the user. In this article, we will look at a common form of input for MIDlets, commands. We’ll also create a sample MIDlet that responds to the corresponding events.

(more…)

Using Custom Threads

Saturday, June 10th, 2006

In this tutorial we will look at using threads in a Java MIDlet. We will create a run() method that implements some simple background logic, create a thread for that logic, and control the thread in the life cycle methods of the MIDlet.

(more…)

Optimizing for Size

Saturday, June 3rd, 2006

MIDlets are intended to run on devices with limited memory and relatively slow wireless internet connections. Therefore, it is important that your MIDlet be as small as possible. Keeping your MIDlet small will help conserve space on the device, and reduce the time it takes to download your application. We will look at several means of reducing MIDlet size, including image optimization, code obfuscation, and custom data compression techniques.

(more…)

Working with Images

Tuesday, May 30th, 2006

This article will focus on how to use images in MIDlets, specifically as it relates to game programming. We will look at how to include image files in your JAR file, creating Image objects from resources, support for transparency in MIDP, as well as usage of the Graphics.drawImage() method.

(more…)

Adding a Canvas

Sunday, May 28th, 2006

The previous tutorial dealt with starting a Java ME project in NetBeans and creating a MIDlet class. This time we will add a simple Canvas class to our project, which does some basic graphics commands.

(more…)

The Making of a MIDlet

Sunday, May 21st, 2006

Now that you know what Java ME is, let’s talk about the NetBeans IDE, and create our first mobile project. We’ll also discuss the required methods of a MIDlet class.

(more…)