Thursday, January 08, 2009

How to code in WRT for Nokia E71
Location of device

I am writing this for myself to keep track of the steps I took to learn "How to code in WRT for Nokia E71" and the outside reader may discover something useful too.

Task: Within WRT application discover the location of the Nokia E71 device (at NYC:Cutlass studio for example) and send that information as GET request to to display the page you see on the cell phone micro-browser.


1. The AccuWidget example is useful to see how you can local weather information via an RSS feed from line 91 of accuwidget.js [var url = "" + locationCode;] however the device user must supply the location code from either a menu or special knowledge. I found the interface clunky but that is often expected with example scripts.

2. Check out for some very useful and good looking examples that help me understand the javascript better. In particular, load accordionDemo.wgz [] on your Nokia E71 or whatever device and see an elegant tab solution. Sadly, no device lat/lon help here.
(Forum.Nokia.2008 Code Example Challenge = Web Runtime (WRT): Dou Yongwang (Dougcn) from China is awarded the prize for a series of well-documented examples on how to use the Prototype JavaScript library to create nice widgets, using, e.g. accordion.)

Mac OSX Trick 1.1: Download onto your desktop. Bluetooth > Send file... to your Nokia E71.

Mac OSX Trick 1.2: By right mouse click duplicate the file that you have just downloaded. Now the file reads 'accordionDemo.wgz copy' so double click the file. The file un-zips and there is a folder with all the components of the WRT (.wgz). Open the folder and launch index.html and see the same micro-browser functionality on your Mac OSX browser. Investigate the code.

3. If I wanted to solve my task by J2ME + Google use link J2ME Google Maps API for useful future exploration. Java ME Location API without Google map.

4. Eclipse + WRT plugin, someday I'll be friends with Eclipse.

5. Arghhh, read entry #7, " cannot use location and other system functions through WRT in S60 3rd Edition devices." from Accessing GPS location using WRT - Developer Discussion Boards -- I will solve this tonight!!! Time for Plan B!

6. Wait CS001161 - Obtaining location information WRT on S60 5th Edition may have the beginnings to a solution.

7. Okay, time to bring closure to this. Useful description of Web Developer's Library 1.3 > Guide to Web Developer's Library > Library contents to return to later. Good Location Acquisition API: API description.

8. Check out example Location Service API example from Web Developer's Library 1.3 > Web Runtime API reference > JavaScript Service API reference > JavaScript Location Service API. I built the WRT and it did not produce location results on my Nokia E71. My conclusion: this is reference document and not a practical example for January 9, 2009.

9. My solution to finish this submission to NAVTEQ Global LBS Challenge Americas due today is that looks nice on the Nokia E71.


NAVTEQ Global Challenge

Plan B:
The user writes his/her address into my E71 micro browser form. By some PHP script my server looks up some service like a free US address geocoder (find the latitude & longitude of any US address - for free ... Free lookups are throttled by your IP address to one request every 15 seconds.) that returns the address as latitude and longitude. I drag take the lat/lon through more PHP and finish the task. I have used a variation of Plan B in 2006 for LBS game Hot-n-Cold, semi-finalist in NAVTEQ Challenge.


wallyoh said...

Great post Steve, gave me a leg-up on where to start with developing for Nokia.

Quick question, I am looking into getting my E71 to e-mail me my GPS position. I looked at the Location widget sample on Nokia forum but was not a 100% sure of what they were trying to do.

I was hoping you could help, thanks.

TheRohan said...

Hey guys, Check out the updated version of Web Runtime: BetaLabsWidget

This is a web widget application allows users to browse the applications in Nokia Beta Labs. The application is compatible with Symbian^3 and Symbian S60 5th Edition devices and it has been optimized for the touch UI. The updated version adds tabs and a homescreen widget.

To download the updated version of Web Runtime: BetaLabsWidget Example check the link: