The first thing you need to do is ensure that your machine can talk to your phone. We used Bluetooth for our communications. We also downloaded and installed the Nokia PC Suite so we could use the File Manager tool for transfering files from your local machine to the phone.
To make things easier, we set up the demos on our local machine, ensured they were working ok, and then transfered them to the phone. So the first thing we had to do was ensure that we had the right VM set up locally.
Since Eclipse uses an XML parser to read the registry and other files, you will need to get bundles that provides the XML Parser APIs. A good candidate for this are 2 bundles (org.eclipse.ercp.xml, org.eclipse.ercp.xmlParserAPIs) which are included as part of the eRCP project. These two bundles are created as framework extensions so you need to tell OSGi about them by setting a system property:
Now when you try and run, you will likely get an exception saying that OSGi couldn't match the required Execution Environment for some of the bundles. They are looking for the Founation 1.0 EE but the current VM doesn't match this. So we need to create a new profile which looks like this:
In order to set up the phone for a demo, we wanted an IP address. The best way to do this (since you don't know where you are going to give a demo or the network status when you are at that location) is to set up an adhoc network on your local machine and then connect to it from the phone.
The most convenient way to connect to the phone is to use the USB cable. To get this to work, I needed to update my drivers. I got updated drives from sftp.savaje.com. Instructions for installing the drives can be found in the documentation accompanying the phone, and online at the SavaJe Wiki. In short, you need to:
Once the drivers have been installed, go to System->Hardware->Device Manager->Modems. Under Modems, you sould see two entries starting with GSPDA Mobile Device Modem. In my case, the two had the exact same name, except the second had '#2' at the end. In any case, right click the second entry, and select properties. Go to the Advanced tab, and hit 'Advance Port Settings...'. At the bottom of that screen, take note of the COM Port Number, you'll need it to connect a Hyperterminal to the phone.
When you first plug your phone into the computer, it should (This is what happened for us) get treated as a memory stick, or other removable drive. At this stage, you can place your application on the drive. Once you want to use these files on the phone, you need to Unmount the memory card (Using the Stop Hardware button for windows). This is because the memory card can't be mounted by the phone and the PC at the same time. If you want to remount the memory card, you need to unplug teh USB cable, and plug it back in (There should be a better way to do this, but I haven't figured it out yet).
To read console output (e.g., System.out.println() statements), you need to start a hyperterminal, and connect it to the phone. On windows, you can do this by going to Program Files->Accesories->Communications->Hyperterminal. In the 'Connect Using' drop-down list, choose the COM port that the GSPDA Mobile Device Modem drivers are using (2 paragraphs up). Choose 115200 bits per second, 8 data bits, No parity bit, stop bit = 1, and No flow control.
We want to write a simple Midlet for the Jasper S20 phone. First, we need a suitable development environment to write, and test, the midlet locally on our machine. To do this, we installed Eclipse ME, a plugin for Eclipse. As the homepage states, you can install this plugin really easily by setting a remote site, with as the URL.
Once you've written a Midlet to your satisfaction, you may want to test it on an actual phone. To deploy your midlet, bring up the context menu on your Midlet project, and select J2ME -> Create Package
In your midlet project, there should be a folder called deployed. In that folder, there should now be two files [project name].jad, and [project name].jar. Place these two files in a directory, on your phone's memory expansion card, called MidletInstall (We placed the two files in a subdirectory named after the project, but I'm not sure what effect, if any, this had). Next replace (or remount) the memory card back in your phone, and open the Application Manager in the Utilities menu. You should see your Midlet in the list of applications to install. Press 'Install', and you're ready to go.
There isn't currently an eclipse plugin for creating Xlets, so a little more manual work is required. First, we got a suitable JRE. We chose to use Personal Profile 1.1, which we downloaded using instructions from the J9 page. The only difference is that in step 7 we chose 1.1, isntead of 1.0. Also take note of the last part of that article, Foundation 1.1. It applies to Personal Profile 1.1 as well. Once you install this JRE into eclipse, you'll probable need to add ppro-extras.jar, and ppro-ui.jar, using Add External Jar. Ppro-ui.jar, in particular contains the Xlet class, which your main class needs to implement.
To set up a project in our workspace, we created a standard Java project, and chose PPRO1.1 as the associated JRE. Our particular project required Swing classes, so we added SavaJeDevelopper.jar as a library (This came with the developper version of the phone). When writing an Xlet your main class should implement the Xlet interface.
To run your Xlet on the phone, create a directory called savaJe/bundles on the memory expansion card. Inside this directory create a directory named after your Xlet project. Inside this directory, you'll need a file called bundle.jnlp, a file called bundle.policy, and a fodler called lib. Next, export your Xlet project as a JAR file. You will not need to export the .classpath or .project files, so uncheck those. Name the file classes, and choose to export it to your lib directory.
Normal java files can be run using JNLP, similarly to xlets. That is, having a bundle.jnlp file, a bundle.policy file, and a folder called lib with the jar'ed classes you want to run. As far as we can tell, the jar file that has the entry point to your java application has to be called classes.jar, and has to be in the lib folder.
You can add classes and jars to the class path using the jar href tag:In this example, addon.jar is not located in the subfolder lib, as you might except. Instead, it is located in I:\home\Output\lib (I:\ is the drive name for the memory card, on the phone that would appear as /cf0/home/Output/lib).
795a8134c1