1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
4
Copyright 2007, Google Inc.
6
Redistribution and use in source and binary forms, with or without
7
modification, are permitted provided that the following conditions are met:
9
1. Redistributions of source code must retain the above copyright notice,
10
this list of conditions and the following disclaimer.
11
2. Redistributions in binary form must reproduce the above copyright notice,
12
this list of conditions and the following disclaimer in the documentation
13
and/or other materials provided with the distribution.
14
3. Neither the name of Google Inc. nor the names of its contributors may be
15
used to endorse or promote products derived from this software without
16
specific prior written permission.
18
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
19
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
21
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
<title>Sample Applications</title>
33
<link rel="stylesheet" type="text/css" href="gears.css" />
38
<h1>Sample Applications</h1>
40
<div id="pagecontent">
42
<p>This page lists sample applications that use Gears API. Sample
43
code is found in the /samples directory of the the zipfile provided below, or by using the <em>view source</em>
44
feature of your browser. </p>
45
<p>Download the sample code from the <a href="tools.html#samples_and_tools">Resources and Tools</a> page. </p>
50
<h2>"Hello, World" Samples </h2>
51
<p class="note"><span style='color:red'>Note :</span> To see the sample
52
applications working, you must first <a href="install.html">install
54
<p><a href="samples/hello_world_database.html">Database Demo</a><br />
55
Shows how to read and write data locally using the
56
<a href="api_database.html">Database</a> module.</p>
58
<p><a href="samples/hello_world_file_system.html">File System Demo</a><br />
59
Demonstrates using the file picker for choosing multiple files; filtering on
60
MIME type; and displaying the results to the screen</p>
62
<p><a href="samples/hello_world_geolocation.html">Geolocation Demo</a><br />
63
Demonstrates basic usage of the <a href="api_geolocation.html">Geolocation</a> module.</p>
65
<p><a href="samples/hello_world_resourcestore.html">ResourceStore Demo</a><br />
66
Uses the <a href="api_localserver.html">LocalServer</a> module
67
to capture a URL so that it can be viewed while offline.</p>
69
<p><a href="samples/hello_world_managedstore/managed_store.html">ManagedResourceStore Demo</a><br />
70
Uses the <a href="api_localserver.html">LocalServer</a> module to capture
71
a versioned set of URLs, and updates the entire set to a new version.</p>
73
<p><a href="samples/hello_world_shortcuts/hello_world_shortcuts.html">Shortcut Demo</a><br />
74
Shows how to create desktop shortcuts using the
75
<a href="api_desktop.html">Desktop</a> module.</p>
77
<p><a href="samples/hello_world_workerpool/hello_world_workerpool.html">WorkerPool Demo</a>
79
Performs a long-running computation without blocking the UI, using the
80
<a href="api_workerpool.html">WorkerPool</a> module.</p>
84
<h2><a name="example_db" id="example_db"></a>Sample Application: Gearpad </h2>
85
<p>Gearpad is simple web-based notepad which allows you to read and write notes, even
86
offline. Gearpad transitions between online/offline states seamlessly,
87
even when the network connection is intermittent.
90
<b>Source location:</b> <code>/samples/gearpad</code><br />
93
<b>Modules used:</b> Database, LocalServer.
96
<b>To run Gearpad:</b>
98
<li>Set up a PHP server and a MySQL database</li>
99
<li>Create a database using the db.sql script</li>
100
<li>Place the Gearpad files under you PHP server's document root</li>
101
<li>Customize _dbconfig.php if necessary</li>
104
<h2><a name="running_man" id="running_man"></a>Sample Application: RunningMan</h2>
105
<p>A simple JavaScript application that uses the Gears APIs
106
on Android. RunningMan is a location-aware
107
stopwatch that measures both the time and route taken for a journey, showing
108
the journey on a map.
109
<p>Check out the <a href="articles/running_man.html">RunningMan
110
tutorial</a> for step-by-step instructions.
112
<b>Modules used:</b> Database, Desktop shortcuts, Geolocation, and LocalServer.