Skip to content

Commit

Permalink
added Symbian and webOS...updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
brianleroux committed Oct 28, 2010
1 parent f10aff6 commit 03ee7cc
Show file tree
Hide file tree
Showing 56 changed files with 6,620 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ PhoneGap is a web platform that exposes native mobile device apis and data to Ja

Get started
-----------
* http://phonegap.com/start
[phonegap.com/start](http://phonegap.com/start)

Community
---------
* Website - [phonegap.com](http://phonegap.com)
* Mailing List- [groups.google.com/group/phonegap](http://groups.google.com/group/phonegap)
* Wiki - [phonegap.pbwiki.com/](http://phonegap.pbwiki.com/)
* Twitter - [twitter.com/phonegap](http://twitter.com/phonegap)

Website ........ [phonegap.com](http://phonegap.com)
Mailing List ... [groups.google.com/group/phonegap](http://groups.google.com/group/phonegap)
Wiki ........... [phonegap.pbwiki.com/](http://phonegap.pbwiki.com/)
Twitter ........ [twitter.com/phonegap](http://twitter.com/phonegap)
Issues ......... [phonegap.lighthouseapp.com](http://phonegap.lighthouseapp.com)


License
Expand Down
57 changes: 57 additions & 0 deletions Symbian/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
SHELL = /bin/sh
CHMOD = chmod
CP = cp
MV = mv
NOOP = $(SHELL) -c true
RM_F = rm -f
RM_RF = rm -rf
TEST_F = test -f
TOUCH = touch
UMASK_NULL = umask 0
DEV_NULL = > /dev/null 2>&1
MKPATH = mkdir -p
CAT = cat
MAKE = make
OPEN = open
ECHO = echo
ECHO_N = echo -n
JAVA = java

all :: js package

clean :: clean_libs

clean_libs:
-$(RM_RF) lib

package:
cp lib/phonegap.js framework/www/phonegap.js
cd framework/ && zip -r app.zip www/* -x www/wrt_preview_frame.html www/wrt_preview_main.html www/preview/ www/*.wgz
mv framework/app.zip app.wgz

js: lib/phonegap.js

lib/phonegap.js: js/phonegap.js.base js/acceleration.js js/accelerometer.js js/audio.js js/camera.js js/camera/com.nokia.device.utility.js js/camera/com.nokia.device.framework.js js/camera/s60_camera.js js/camera/com.nokia.device.camera.js js/contacts.js js/debugconsole.js js/device.js js/geolocation.js js/map.js js/network.js js/notification.js js/orientation.js js/position.js js/sms.js js/storage.js js/telephony.js
$(MKPATH) lib
$(RM_F) $@
$(CAT) js/phonegap.js.base >> $@
$(CAT) js/acceleration.js >> $@
$(CAT) js/accelerometer.js >> $@
$(CAT) js/audio.js >> $@
$(CAT) js/camera.js >> $@
$(CAT) js/camera/com.nokia.device.utility.js >> $@
$(CAT) js/camera/com.nokia.device.framework.js >> $@
$(CAT) js/camera/s60_camera.js >> $@
$(CAT) js/camera/com.nokia.device.camera.js >> $@
$(CAT) js/contacts.js >> $@
$(CAT) js/debugconsole.js >> $@
$(CAT) js/device.js >> $@
$(CAT) js/geolocation.js >> $@
$(CAT) js/map.js >> $@
$(CAT) js/network.js >> $@
$(CAT) js/notification.js >> $@
$(CAT) js/orientation.js >> $@
$(CAT) js/position.js >> $@
$(CAT) js/sms.js >> $@
$(CAT) js/storage.js >> $@
$(CAT) js/telephony.js >> $@
66 changes: 66 additions & 0 deletions Symbian/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
PhoneGap Symbian (WRT)
=====================================================
PhoneGap Symbian.WRT is a skeleton application for Nokia's Web RunTime, along with javascript wrapper libraries, which allow a developer to build a native application for a WRT Supported Symbian phone using web technologies. The same set of web application files can be ported to PhoneGap BlackBerry, iPhone, Palm, and more to come...


Pre-requisites
-----------------------------------------------------
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
---------------------------
1. Place your web application in the phonegap_root/symbian.wrt/framework/www folder
2. Ensure 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 existing sample as a guide)
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

Make targets:
- make js (compile the javascript source into lib/phonegap.js)
- make package (package the contents of framework/www/ into a .wgz package file, installable to the device)

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 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:

1. Add the info.plist file to the application folder.
2. Compress the application 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).


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.

1. Install Aptana Studio and the Nokia WRT plug-in.
2. Go to File -> New -> Project. Select Nokia Web Runtime -> New Nokia Web Runtime Widget.
3. Select your desired project name and file locations. Click Finish. You should now see some additional internal application files/folders.
4. Copy your web application pages into the project folder (unless starting from scratch).
5. Ensure that the MainHTML property in info.plist refers to your application starting page.
6. Right click on the file "wrt_preview_frame.html", and select Debug As -> Javascript Web Application.

Your application should run inside Firefox, with the phonegap API functioning and returning test data for geolocation, contacts, acceleration, etc.

Notes
------------------------------------------------------
- The memory available to WRT apps is very limited. Loading large javascript files into memory, playing sound files, and excessive monitoring of sensors can fairly easily crash your application. Minify js files, and use sensor monitoring (accel, gps, etc) conservatively.
- 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.
- Javascript animation in WRT is not great. I've tried dojo, scriptaculous, & emile, to no avail. You can leave it in ... your app will reach the animation end state ... but the animation itself won't be pretty.

Helpful Links
-----------------------------------------------------
- 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/
Binary file added Symbian/framework/www/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Symbian/framework/www/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Nokia//DTD PLIST 1.0//EN" "http://www.nokia.com/DTDs/plist-1.0.dtd">
<plist version="1.0">
<dict>
<key>DisplayName</key>
<string>phonegap.wrt</string>
<key>Identifier</key>
<string>com.nitobi.phonegap.demo</string>
<key>Version</key>
<string>1.0</string>
<key>AllowNetworkAccess</key>
<true/>
<key>MainHTML</key>
<string>index.html</string>
<key>MiniViewEnabled</key>
<false/>
</dict>
</plist>
19 changes: 19 additions & 0 deletions Symbian/framework/www/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PhoneGap Symbian.WRT</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script language="javascript" type="text/javascript" src="phonegap.js"></script>
<script language="javascript" type="text/javascript">

document.addEventListener('deviceready', function() {
// device ready! initialize your app.
}, false);

</script>
</head>
<body>
Build your phonegap app here! Dude!
</body>
</html>
Loading

0 comments on commit 03ee7cc

Please sign in to comment.