This tutorial provides instruction on setting up PhoneGap for your web application on Nokia S60 5th Edition devices.
Phonegap for Nokia is dependent upon Nokia's Web Runtime (WRT), which is included on Nokia S60 5th Edition devices.
Download the phonegap source from http://github.com/sintaxi/phonegap, or using the command:
git clone git://github.com/sintaxi/phonegap.git
1. Place your web application in the nokia/www folder
2. Ensure js/phonegap.js is included in your main html page
3. Place your application icon in the www folder. It should be named Icon.png
4. Modify info.plist (use the sample as a guide, or refer to Nokia's Web Runtime (WRT))
5. Develop your application around this html file ... only this page will have access to the device api
6. Compress the www folder into a zip file, and change the .zip extension to .wgz
7. Transfer this file to your S60 5th Edition device, and open it. The device should recognize and install the application
As you can see, you don't need to have any particular tools installed in your development environment to build WRT applications, as there is no building or compiling involved. However there are tools you can use to make development easier. The combination of Aptana Studio and Nokia's WRT Plug-in for Aptana worked nicely for developing and testing WRT applications. It includes an emulator (only for PC) and a browser-based javascript emulator, and can deploy applications directly to your device if bluetooth is enabled.
A sample application resides in nokia/www/ which demonstrates the use of various device features through the phonegap API. Get an overview of the anatomy of a WRT application here. 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:
1. Compress the www folder into a zip file.
2. Change the .zip extension to .wgz.
3. Transfer the file to your phone, via bluetooth, downloading from the web, or from email, etc.
4. When you receive the message, your device should recognize the file type and install the application.
Note: a limitation of WRT is that you must define one main html page (defined in info.plist), and this page is the only one which will have access to the device functionality (geolocation, vibration, etc.). You can still use multiple pages, and pages not accessing device functionality will be accessible, but we recommend instead swapping views in and out of the main html page using a local xmlhttprequest, or building a javascript application (swapping views by showing and hiding divs).
Comments (1)
Michael Bierman said
at 12:50 pm on Nov 24, 2009
If you use the Nokia WRT plug-in for Aptana Studio the plug-in will take care of packaging the widget (compressing the project) and changing the file extension. the plug-in also provides options to deploy to the S60 Emulator, to an actual device, and provides preview and platform simulation without having to install the Emulator.
You don't have permission to comment on this page.