Skip to content
jxp edited this page Mar 16, 2012 · 10 revisions

PhoneGap Desktop

What is it?

A javascript library for simulating the entire PhoneGap API on a desktop browser.
It features;

  • All API calls are reproduced and return approriate values
  • All events are reproduced (most are triggered manually when needed)
  • Touch events are mapped to mouse events
  • Easily extensible to support plugins
  • Written in pure javascript for maximum browser compatibility and no additional dependancies

Why is it?

Getting started on PhoneGap, I loved the concept but sometimes found the turnaround time frustrating.
Making a minor change to the code sometimes involved deploying to the emulator or a device several times (including hooking up remote debugging once or twice).
It seemed like it would be much easier to do some of that on a local desktop browser.

This is not a replacement for testing on a device
It is intended to be used for much of the code-check-revise cycle.

How does it work?

PhoneGap desktop loads data from a json file to an in memory object. This data is then returned from the API functions.
You can easily substitute the desktop library for the PhoneGap device library.
Ordinarily you will not need to write any special code for handling desktop/device differences. You will likely want to customise the json data to match your project requirements.

PhoneGap Kitchen sink app running in Chrome with the Developer tools open PhoneGap Kitchen sink app running in Chrome

Read more

Browser compatibility
Getting started
Config settings
Supporting a plugin
API methods