CS437/CS641 Group Project Information for Nokia Devices

Winter Session 2004




Introduction

Using the Nokia 3600 phone and their N-Gage gaming deck is not at all difficult, but there are enough minor difficulties and undocumented features that a small write-up of this sort might help out those of you who are using the Nokia devices as a implementation platform for your game project. If you are not using these devices for your project, you do not need to worry about this document.

To begin, it is likely a good idea to take a read through the manuals for the devices. The 3600 phone and N-Gage gaming deck are quite similar under the hood, so learning about one goes a long way towards learning about the other. (There are some differences here and there, but not enough to worry about at this point.) Fortunately, the 3600 phone comes with a manual in the box, although one can also be downloaded. Sadly, the N-Gage does not come with a manual, but only a little quick start guide. The manual can be found on the CD, and can also be downloaded as well. The N-Gage support site also has links to several tutorials covering how to use the N-Gage to do various things.

As an important note, both the 3600 phone and N-Gage gaming deck come with software CDs in their boxes. Unless you plan on using Bluetooth to communicate with either your 3600 phone or N-Gage, or infrared to communicate with your 3600 phone (the N-Gage does not support infrared), you do not need to install the software on the CD. The PC Suite package for the devices is nice and convenient, but only if you use Bluetooth or infrared. Otherwise, you will end up with extra drivers and other unnecessary software on your PC.

Getting Ready to Use the Devices

There are a fair number of pieces in the boxes of both the 3600 phone and N-Gage gaming deck. Many of these are surprisingly expensive and hard to replace for their small size, so be careful and don't lose them! Be sure to keep some of the little bags and twistie-ties used to organize the boxes, as those can come in handy when repackaging them when you are done.

This is likely a good point to review the quick start guides for the devices, as they have some easy to follow steps, and some nice pictures to point things out to you. Here are a few extra pointers and tips:

With a full battery, and all of the cards in right places, you are now ready to start using the device.

Powering Up and Basic Use

When turning the device on, you will have to hold the power button for a few seconds. The screen will turn white, you'll see a Nokia logo, and it will then power up. This concerned me at first, but they do it to prevent the device from accidentally powering up when you don't really want it to.

When the device is turned on for the first time, it will prompt you for the time and date. To do this, you can either numerically key in the time, or use the direction controller and selection keys to do so. On the 3600 phone, the direction controller is a round disc with four arrows around it, below the phone display. The left and right selection keys are immediately below the display and above the direction controller. On the N-Gage, the direction control is a round disc with four arrows around it, this time located to the left of the display. The left and right selection keys are to the lower left and lower right of the display.

One thing that you will notice on first use as well is that the devices will complain about "SIM card registration failing" or some such thing. Basically, it is telling you that the SIM card you put in does not have cellular service. Besides this complaint, the device will work totally fine. On the N-Gage, you can disable this check by putting the device into its offline profile. (You can still use Bluetooth in the offline profile though!) For information on how to do so, refer to the N-Gage manual.

Most device functionality is accessed through the menu. There is a menu button on both devices. Icons can then be navigated using the direction controller and selection keys. To launch an application or go into a folder, you can press the direction controller in the middle. (Pushing off to the side will move the selection ... you need to get it in the middle. It will take practice, but is handy.) The other approach is to press the left selection key. The left selection key is treated almost like right-clicking something in Microsoft Windows ... it usually brings up a menu of everything you can do with the selected item. The right selection key usually backs you out of wherever you are. The precise functions assigned to the left and right selection keys are usually displayed in the lower left and lower right parts of the display.

To turn off the device when done, press the power button again. This time, you won't need to hold it. A menu will appear, from which you simply select the switch off option. That's it!

Connecting to the Devices

Unless you plan on using Bluetooth or infrared, you will not be connecting directly to the 3600 phone. While the N-Gage supports Bluetooth too, you will likely be accessing it through its USB interface. If you do plan on using Bluetooth or infrared, you will have best luck in installing and using PC Suite as well. Please refer to the device documentation, PC Suite documentation, and documentation for your Bluetooth or infrared adapter for more information.

The easiest way to talk to these devices is through the N-Gage USB cable. When the N-Gage has a memory card inserted, is powered on, and is connected through a USB cable to a PC, a new logical disk drive will appear in Windows for the memory card. This will work under Windows XP, and likely some older versions as well. Files can then be dragged to and from the device for later installation or use, much in the same way they could from a floppy disk or other drive. A few notes:

When using the USB cable, the N-Gage has in essence become a memory card reader. If you have a memory card reader that supports MMC cards, you might be able to use that for file transfer as well. Again, if you choose to do so, be careful not to corrupt the cards. Either way, once files are on the memory card, the card itself can be moved between a 3600 phone and an N-Gage, without any difficulties (as long as the devices are off when you do so!)

As a note, you can always move stuff from the memory card to the device's on board memory. We'll take a look at how to do so in a moment.

Installing, Uninstalling, and Moving Files Around

At this point, you have the basics behind using the mobile devices, and how to get files into the devices through a memory card. Now, what do you do with them. Your interface on the device so far has been limited to what is accessible through the menu, and there is no file explorer there. How do you work with files then?

Installing .SIS Applications

A .sis file is similar to a ZIP file or TAR file. It is basically a container that contains multiple files. Actually, it is a little smarter than that, because it contains information on how to properly install the files within the container as well. So, it is a little closer to a Windows installer package, or an RPM in the Linux world. Either way, this is the main way of getting non-Java applications onto the device. (Java applications work differently, and will be looked at in a moment.)

To install a .sis application file, make sure it is in the root directory of the memory card. From the device, access the Tools folder from the main menu, and launch the Manager program. (If you cannot find the Tools folder from the main menu, you may need to scroll down a bit first.) From within this program, select the .sis file you want to install, and then press the left selection key. This will give you a menu, with an option to install. You will typically be prompted for additional information, including an installation location. Wherever possible, install to the memory card to keep things clean. If you do install something to the device's memory, be sure to remove it before turning the device back in. (See below for details.) Once the application has been installed, it is now accessible from the main menu, usually at the bottom.

Installing Java Applications

This is a little trickier. If you place a Java archive or .jar file in the root directory of the memory card, you will notice that the Manager used above does not see the file. That on its own isn't bad, because that isn't the tool to use for Java applications. They are organized under the Apps tool in the Extras menu on the N-Gage, or in the main menu of the 3600 phone. Even with this tool, you cannot find the applications ... yet.

The issue comes from the fact that the devices only want to install a Java application from a specific directory. Don't ask why ... that's just life. The problem is that this special directory is on the device itself, which cannot be accessed using our USB cable above. So, we need an extra tool ... a file explorer to be exact, that can handle this for us on the phone. To do this, you need a copy of FExplorer, a freeware tool that can be found here. This is a .sis application, and can be installed as discussed above. This tool will then be accessible from your device's menu. When you run this tool, you will see several drive letters. The E: drive is your device's memory card. If you navigate there, you will see your .jar file to install. Highlight this file, and use the left selection key to open the file. This will automatically take you through the installation process. When done, the installed Java application can now be accessed using the Apps tool discussed in the previous paragraph.

Removing Applications

If you are wanting to remove an installed .sis application, you can use the Manager tool to do remove both the installed version and the original .sis file. When you run the tool, you simply have to highlight what you want to remove, and use the left selection key. The menu that pops up will have a remove option that will remove the application from wherever it was installed. The same process can be used to remove the .sis file too.

To remove a Java application that has been installed, you first need to run the Apps tool. You then highlight the application to remove, and use the left selection key again. This gives you a menu, from which you select remove to get rid of the application. Of course, the original .jar file is still occupying memory too. To remove it, you will need to use FExplorer, find the file, highlight it, and use the left selection key to access a menu with a removal option.

You can also remove files when the device is connected to your PC using the standard removal mechanisms accessible on Windows. Two notes though. One is that you should only remove what you have installed yourself with this method. (Otherwise you can end up in trouble very quickly!) The other is that this will add files to the recycle bin on the memory card, so you will need to empty this as well!

Moving Files Around

The FExplorer tool discussed above is a general purpose file explorer. You can move files around on the memory card, and transfer them from the memory card to the device's internal memory. It is not recommended, however, that you use this tool to move an installed application. It is far better to uninstall it, and then re-install it in its new location. Otherwise, the chances of it working are quite slim.

The FExplorer tool has some other interesting features. For example, it also allows you to take screen captures. So, when you have your Java game up and running, you can use this feature to snap an image on the device itself!

Setting up a Java Build Environment under Windows XP

After a first failed attempt to get things working, a second installation attempt has been successful. Apparently, it can be quite picky about JDK versions and other seemingly minor issues, so take some care! When you're done, you have a nice development environment, a device emulator (very cool), and best of all, you can do it all for free! Here's what you need to download first:

I basically installed everything in the above order, and used the default install directories for each component. When installing Nokia Developer's Suite, you can choose the JBuilder option, and it will integrate into the environment. After integrating, you will have an extra Nokia option under the Tools menu for accessing Nokia emulators and so forth.

You might also want to configure an additional JDK for your projects from the Nokia Developer's Suite. If you follow the above steps, you will have two JDKs installed as far as JBuilder is concerned when you look under the Tools menu, Configure JDKs. (The built in one with JBuilder, and a J2ME kit provided with MobileSet.) The J2ME kit may be able to do everything you want, but you might as well have the JDK provided by Nokia as well. From within the Configure JDKs option, select New. You then choose the location of the JDK as: C:\Nokia\Devices\Series_60_MIDP_Concept_SDK_Beta_0_3_1_Nokia_edition, if you used the default install location. Everything else should be fine from there. To use this JDK, you will have to change Project Properties under the Project menu, by changing the JDK option on the Paths tab. (It may be wise to change the default project properties as well.)

You can find some interesting examples installed with the tools. For example, if you look in C:\Nokia\Tools\Nokia_Developers_Suite_for_J2ME (assuming you installed the Nokia Developer's Suite in the default location), you will find some MIDP 1.0 and 2.0 examples. These are various Java programs that can do various things and can be run in the built in emulators. While there is a really slick example (Ocean Diver) in the MIDP 2.0 directory, our devices are intended to support MIDP 1.0. If the .jar file is installed on the device, it will not likely work properly. Nevertheless, you might be able to use a fair bit of the sample code there. (MIDP 1.0 can do most of what MIDP 2.0 can do, but requires you to do more work.) The MIDP 1.0 code definitely does work, and should not cause any problems at all. (I tested it both in the emulators and on our devices.)

As a side note ... you should be able to get all of the above for Linux as well. I have no idea what is involved with that installation, so you are on your own that way. But, all the pieces are there, including the Java kits, JBuilder, and Nokia Developer's Suite.

Setting up a Java Build Environment under Linux

This actually worked reasonably well on my first attempt under Redhat 9.0. There were permission issues to sort out, but it otherwise went reasonably smoothly. Once again, we'll be following a similar approach with our free tools. Here's what you need to download first:

You note that we got roughly the same tools from the same location. We did not get the MobileSet for JBuilder this time, but it did not seem to be necessary. (Which is good, because there isn't a Linux version anyways!)

The install procedure will be quite familiar ... put things in the default locations as much as possible, and install in the above order. When the Java is installed, you must make sure that it is the version available when installing the Nokia installer, or else it will not work. (You may either need to move an existing installation, or update your PATH when running the Nokia software ... it just executes "java", so make sure it finds the right one!) You probably need to make sure it is the one available when running JBuilder after the Nokia stuff is integrated.

As a side note, you must make sure that the user account running JBuilder with the integrated Nokia Developer's Suite has read and write permissions to the directory where the Nokia Developer's Suite was installed. If you install everything as root, you will need to change the permissions manually. If you install Nokia Developer's Suite as another user, you will likely need to make sure that the same user installed JBuilder as well. It is a bit of a pain, but nothing chmod cannot fix!

At this point, the tool will work just fine. I was even able to add it to my GNOME menus and panels, and it works fine. (You may need to specify the full path to JBuilder when you run it, or execute the tool from the directory in which it was installed, or else you may have problems.) From here, you probably want to configure JDKs and so forth as described under Windows XP, and you will have the same functionality: an integrated development environment, emulator, and so on!