PhoneGap Palm
PhoneGap Palm is a skeleton Palm webOS application, along with javascript wrapper libraries, which allow a developer to build an application for a Palm webOS phone using web technologies.
If you don't intend to change the phonegap.js code you can follow this shortened simpleGetStartedWithPalm
Prerequisites
- Install cygwin and make sure you select "make" as it is not included by default (required to run the Makefile script)
- You can access your C:\ drive through: /cygdrive/c
- Install VirtualBox: the Palm emulator runs as a VirtualBox virtual machine
- Install webOS SDK: Available for Windows, OS X, and Linux
- (Optional) Install Git: To clone the phonegap-palm git repository
Download PhoneGap-Palm
-
Using a Web browser
-
Using Git
Starting the Palm Emulator
- Windows
- Start > All Programs > Palm > SDK > Palm Emulator
- OS X
- In the Applications directory, open Palm Emulator.app
- Linux
- At the terminal, type palm-emulator
Package and Deploy the Application
A Makefile resides in the root PhoneGap-Palm directory. Running make allows you to package and install your application to the emulator or device. If a connected Palm device is detected, then the application will be installed to the device. If not, and the emulator is running, the application will be installed to the emulator.
| make |
Package your application and install it to the emulator or device
|
| make js |
Build phonegap.js from the source files to /libs/phonegap.js
|
| make copy_js |
Copies /libs/phonegap.js to /framework/www/phonegap.js
Modify this path if you want phonegap.js in another location
|
| make package |
Builds the webOS app from /framework/www/
into a webOS .ipk installer package in /phonegap-palm/palm/
|
| make deploy |
Installs the .ipk package to a device if detected, otherwise the emulator if its running |
Creating Your PhoneGap Application
Navigate to phonegap_root/palm/framework/www/; this is where your application will reside. If you have already built a phonegap application on another platform, drop your html,js, css and assets into this folder (starting with the required index.html). Don't forget phonegap.js!
Just open framework/www/ in your favourite editor, build your web app, and run the appropriate make command indicated above. Edit appinfo.json to set your app id, version, etc.
Also, your index.html must include palm's mojo library, upon which phonegap.js depends. So, above your inclusion of phonegap.js, you should also have:
<script language="javascript" type="text/javascript" src="/usr/palm/frameworks/mojo/mojo.js" x-mojo-version="1"></script>
The path is where mojo.js is located on the device.
To enable a javascript debug console, open a new terminal window and type: phonegap-log app_id
Where the app id is your app id as set in appinfo.json.
This will tail your log file; it will default to the device if detected, otherwise it will read logs from the emulator.
In your javascript, use debug.log in your javascript.
Helpful Links
Comments (4)
Nigel Kelly said
at 12:08 pm on Mar 17, 2010
Above worked for me.
The only problem I found was as follows - framework/www/app/views/First/First-scene.html: No such file or directory
This was because my original file structure was framework/www/app/views/First-scene.html.
PhoneGap wants to see First in there for some reason. So I added in First, ran make and it ran. It didn't request Second, Third, etc.
NExt step is to port to iphone.
Etienne SOBOLE said
at 4:47 am on Apr 11, 2010
Hum...
there is nothing into the palm folder for me !
Luke said
at 5:03 pm on Jul 17, 2010
@Etienne SObole, if still stuck... read the readme in the root phonegap directory that you get from GIT... your hint is the word "submodule"
Luke said
at 6:53 pm on Jul 17, 2010
I know I am suppsoed to use noconflict. I think I am supposed to include jquery/jqtouch in the source.json file. I am supposed to look at http://github.com/funkatron/spaz-webos for a working example (not using phonegap). But I just cannot get jqtouch/jquery/mojo/phonegap to work. Can anyone help with this ?
You don't have permission to comment on this page.