I’ve recently compiled and deployed a modified GPS FireEagle location updater for my Blackberry Bold. The process was not as straightforward as I’d hoped for, and I provide the following to aid anyone else attempting the same.

The FireEagle J2ME page points to two resources to help you get started with FE on J2ME; the Fire Eagle J2ME Mobile Updater, and the required dependency J2ME OAuth JAR. Unfortunately, while the OAuth library is currently up-to-date and working with 1.0a, at the time of writing the Fire Eagle Mobile Updater is not compatible with this library; the “fetchNewAccessToken()” call now requires the user verification code as a parameter.

The following video and instructions are a walk through from downloading the required packages, to testing on a simulated device. It assumes that you have Git installed (although alternatively you can download the .ZIP files of these two packages), and Eclipse with the BlackBerry JDE Plug-in (I’m using JDE 4.6.0), both available for free. (The Sun Java ME Platform SDK 3.0 is an alternative IDE, though I had a problem with the parser when working with this code.)

  

  

Steps to getting the example code running

  1. First things first: Get yourself a FireEagle API key. You’ll want the “mobile” version to fit with the mobile app deployment. The necessary credentials are in the form of a “Mobile Auth URL”, “Consumer Key”, and “Consumer Secret”.
  2. Download the J2ME OAuth library. (This walk through is based on the version updated July 27, 2009.) You can grab it from the command line in your chosen directory by typing: git clone git://github.com/fireeagle/j2me-oauth.git j2me-oauth j2me_oauth
  3. Download the FireEagle-updater-midlet (This walk through is based on the version updated May 20, 2009.) You can grab it from the command line in your chosen directory by typing: git clone git://github.com/simonpk/fireeagle-updater-midlet.git fireeagle-updater-midlet fireeagle-updater-midlet
  4. Open up Eclipse
  5. Add the J2ME OAuth package as a new Blackberry project, and in Properties->Blackberry Project Properties->Application, set Project type to “Library”.
  6. Modify the source file: src/net.yahoo.fireeagle.j2me/FireEagleConsumer.java with your own “Mobile Auth URL”, and save.
  7. Add the FireEagle-updater-midlet package as a new Blackberry project, and in Properties->Blackberry Project Properties->Application, set Project type to “Midlet”. Set the Name of main MIDlet class to “FEMidlet”.
  8. Go to Configure the Build Path, and add the J2ME_oauth project to “Projects”.
  9. Replace the source code FEMidlet.java with the contents of this modified FEMidlet.java (adds verify code UI, command, and parameter call).
  10. Modify the FEMidlet.java to populate the AUTH_CONSUMER_TOKEN and AUTH_CONSUMER_SECRET with your own values, and save.
  11. In Blackberry->Edit Build Configurations, add the two projects to Debug and Release.
  12. You can now build and run your Midlet. (See video)

  

Further notes for the Blackberry

  1. The SSL connections used for OAuth will almost definitely need special connection strings to work on your Blackberry platform. For BIS connections, this involves adding “;deviceside=false;ConnectionType=mds-public;EndToEndRequired” to your HTTPS URLs. Download the replacement Util.java that includes examples of BIS connections strings for the two HTTPS connection functions. The connections strings for different connection types are as follows:
    • BIS: “;deviceside=false;ConnectionType=mds-public”
    • BES: “;deviceside=false”
    • TCPIP: “;deviceside=true”
    • WIFI: “;interface=wifi”
  2. You may have to set the timeout on GPS location retrieval to a bit higher for the Blackberry Bold, to stop it from timing out.