View
 

Getting Started with PhoneGap webOS

Page history last edited by Binh An Tran 10 months ago


PhoneGap webOS is a skeleton HP Palm webOS application, along with javascript wrapper libraries, which allow a developer to build an application for a HP Palm webOS phone using web technologies.

 

If you are testing on a device, make sure it is in Developer Mode. If you don't know if developer mode is enabled, please click here.

  

Requirements

 

  • (Windows Only) 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 HP Palm emulator runs as a VirtualBox virtual machine
  • Install webOS SDK: Available for Windows, OS X, and Linux
  • Download the latest copy of PhoneGap and extract its contents. We are only interested in the webOS directory.   

 

Starting the HP 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

 

If the make doesn't start the package, install and launch command, it might be helpfull to modify the makefile starting the commands using the full path: "/cygdrive/c/Program Files/HP webOS/SDK/bin/palm-package.bat" framework/www/

 

Creating Your PhoneGap Application

 

Navigate to phonegap_root/webOS/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.

 

 

Caveats

 

- Touch event not supported, natively. Must use the click event, or maybe we can emulate the touch event by capturing the click event.

- If using Lawnchair, the only supported adaptor is webkitsqlite.

- DON'T FORGET MOJO.JS!!!!!

- html select boxes are implemented by phonegap, not supported natively (believe it or not). only the most basic functionality is implemented, so be aware using this control could cause problems.

  

Helpful Links