Tuesday, December 2, 2008

Device Specific Library Part Two

NOKIA

As you saw, Nokia has an impressive range of J2ME-compatible MIDs on the market. In a fact, they provide a significant portion of the installed user base your games. Fortunately, Nokia has backed thir J2ME hardware with solid support for Java developers -especially game developers.

Using the Nokia SDKs, you will be able to add the following features to your games.
  • Device control for flashing the lights or making the device vibrate
  • Expanded sound support
  • Full screen drawing (beyond Canvas)
  • Extra graphics, including triangle and polygon drawing, transparent image blitting rotation, alpha channels, and direct pixel access.
Nokia provide two distinct tools to help you develop J2ME games for their range or MIDs -the NDS (Nokia Developer's Suite) for J2ME and Java SDKs for individual device. You 'll download and install both of these in the next section.

Installing th Tools

The NDS provides a basic Nokia phone emulator, audio tools, and a simple development environment somewhat similar to Sun's J2ME Wireless Toolkit. (Actually, th NDS is a little better in some ways). It also has supprt for JBuilder and Sun ONE Studio integration, so download it from the Nokia Web site and let's take to tour. To download the NDS, you need to visit Forum Nokia at http://forum.nokia.com.

Navigate to the Java section and then to the Tools and SDKs page. (There's a ton of tool stuff around there, so don't get distracted now!). What you're after is the Nokia Developer's Suite for J2ME. You need to become a member of the developer forum (free of charge) to download these tools .. As you can see, after you download the NDS, install it as you normally would and select the IDE integration you prefer.

The Nokia UI API

Nokia makes additional MIDP features available through the Nokia UI API. You will find a version of the API, in the form of documentation and class files (classes.zip), packaged width most of the device SDKs (such as C:\J2ME\Nokia\Devices\Nokia_7210_MIDP_SDK_v1_0). Each device comes packaged with a complete copy of the Nokia UI, however they are all the same thing.

Life on planet Nokia consist of the classes and interfaces highlighted in Figure 1.

To see a Nokia emulator in action you can just run the executable (such as 7210.exe) found in the bin directory for each device (C:\J2ME\Nokia\Devices\Nokia_7210_MIDP_SDK_v1_0\bin) and then use the file menu to open a Jar file contiaing your classes.

To get things working, you need to add lib/classes.zip to your build class path. Then you will be able to use the classes in the com.nokia.mid.* package. Take a look at the detail of these clause.

No comments: