English | Site Directory

Sample Applications

This page lists sample applications that use Gears API. Sample code is found in the /samples directory of the the zipfile provided below, or by using the view source feature of your browser.

Download the sample code from the Resources and Tools page.

 


"Hello, World" Samples

Note : To see the sample applications working, you must first install Gears.

Database Demo
Shows how to read and write data locally using the Database module.

File System Demo
Demonstrates using the file picker for choosing multiple files; filtering on MIME type; and displaying the results to the screen

Geolocation Demo
Demonstrates basic usage of the Geolocation module.

ResourceStore Demo
Uses the LocalServer module to capture a URL so that it can be viewed while offline.

ManagedResourceStore Demo
Uses the LocalServer module to capture a versioned set of URLs, and updates the entire set to a new version.

Shortcut Demo
Shows how to create desktop shortcuts using the Desktop module.

WorkerPool Demo
Performs a long-running computation without blocking the UI, using the WorkerPool module.


Sample Application: Gearpad

Gearpad is simple web-based notepad which allows you to read and write notes, even offline. Gearpad transitions between online/offline states seamlessly, even when the network connection is intermittent.

Source location: /samples/gearpad

Modules used: Database, LocalServer.

To run Gearpad:

  • Set up a PHP server and a MySQL database
  • Create a database using the db.sql script
  • Place the Gearpad files under you PHP server's document root
  • Customize _dbconfig.php if necessary