| Porting Jil (Vodafone) Widgets to Nokia WRT |
| Written by Administrator |
| Saturday, 31 July 2010 20:02 |
Porting Jil (Vodafone) Widgets to Nokia WRTSince acquiring a Nokia 5230 (one of the Symbian S60 series), I decided that it would be an excellent plan to port all of our maternity toolkit wodgets to the Nokia platform. Since Jil and Nokia WRT widgets are basically light web apps using standard web technologies, they are basically the same. Finally, a touch of standardisation amongst manufacturers! However... there are differences. Jil and Nokia appear to have implemented things just a little differently and such differences snagged the porting process more than once. Let me say firstly, though, I now love Nokia. There are TONS of developer resources, they have a WRT plugin for Aptana Studio, which plugs into Eclipse and loads of video and whatnot to learn about the ins and outs of development. They appear to have actually thought about it, which is refreshing. Now, to porting. The first difference is that Jil widgets have a descriptor file called config.xml. Nokia widgets have info.plist. Fair enough. Happily, Eclipse will take care of such manifest files for you so no great stumbling block there. Secondly, the il API refers to the Widget object. So does Nokia, but with a small w. A small difference, but important. Third, they both implement setPreferenceForKey() as a method of storing persistant data. The difference is that Jil calls for setPreferenceForkey("name", value), but Nokia does it the other way around: setPreferenceForKey(value, "name"). Jil seems to be a bit more forgiving than Nokia in the use of setpreferenceForKey(). With Jil, you check: does it exist? If not, create it. With Nokia, it's more involved. You check "does this thing have a type of undefined? or is the value of this thing null?" Then you create it. These differences took a while to figure out, but once I had them licked, porting my second app took a fraction of the time. Obviously, these widgets being javascript, debugging them is a pain. You can always use Firebug and the Chrome developer tools to debug, but not once you start using non-standard things like the widget APIs... then Firefox chokes, which obviously sucks. However, Eclipse can help some, and it's actually pretty simple to incorporate Firebug Lite into your widget project to figure out your css. Lastly, I'll say that the Nokia preview emulator is fantastic. Simple, quick and an accurate portrayal of how the phone works, it is simply streets ahead of the Jil emulator, which grinds your PC to a standstill as it labours is buggy way through a widget. I think in future I'll be developing for Nokia and porting to Jil! |