PhoneGap Symbian (WRT)
There are no real pre-requisites for PhoneGap Symbian.WRT development, as a WRT application consists simply of web files (html, css, js, etc) packaged and compressed into a .wgz file. No build process is necessary. However, for the purposes of development efficiency and testing, the following tools will make life MUCH easier:
- Aptana Studio and Nokia's WRT Plugin for Aptana Studio. Includes a limited but very handy browser-based device simulator.
- Optionally S60 5th Edition SDK, which includes the Symbian device emulator.
Set up your dev environment
- Place your web application in the phonegap_root/symbian.wrt/framework/www folder
- Ensure phonegap.js is included in your main html page
- Place your application icon in the www folder. It should be named Icon.png
- Modify info.plist (use the existing sample as a guide)
- Develop your application around this html file ... only this page will have access to the device api
- Compress the www folder into a zip file, and change the .zip extension to .wgz *
- Transfer this file to your S60 5th Edition device, and open it. The device should recognize and install the application
- make package (package the contents of framework/www/ into a .wgz package file, installable to the device)
A sample application resides in available at http://github.com/wildabeast/phonegap-demo which demonstrates the use of various device features through the phonegap API. It is essentially just a local website with a couple of rules: you must have an info.plist file and a main html page. To deploy this to your S60 5th Ed. device:
- Add the info.plist file to the application folder.
- Compress the application folder into a zip file.
- Change the .zip extension to .wgz.
- Transfer the file to your phone, via bluetooth, downloading from the web, or from email, etc.
- When you receive the message, your device should recognize the file type and install the application.
Debugging your Symbian.WRT PhoneGap application
Creating your PhoneGap Nokia project in Aptana Studio's WRT Plugin allows you to simulate the on device behaviour of your application in a browser.
Get the Aptana WRT Plugin here. The simulator requires Firefox and Firebug.
- Install Aptana Studio and the Nokia WRT plug-in.
- Go to File -> New -> Project. Select Nokia Web Runtime -> New Nokia Web Runtime Widget.
- Select your desired project name and file locations. Click Finish. You should now see some additional internal application files/folders.
- Copy your web application pages into the project folder (unless starting from scratch).
- Ensure that the MainHTML property in info.plist refers to your application starting page.
Your application should run inside Firefox, with the phonegap API functioning and returning test data for geolocation, contacts, acceleration, etc.
- If your symbian phone has contacts synced via PC Suite or Ovi Sync, and you attempt to query the contacts api, your app will crash. This is discussed here: http://discussion.forum.nokia.com/forum/showthread.php?t=170839&highlight=contacts+api+crashing. Hopefully nokia will fix it soon.
- PhoneGap API Docs: docs.phonegap.com
- PhoneGap Wiki: phonegap.pbworks.com
- Nokia Web Runtime: http://www.forum.nokia.com/Technology_Topics/Web_Technologies/Web_Runtime/