Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding readme to all samples.
  • Loading branch information
mangini committed Oct 5, 2012
1 parent c6957d7 commit 2b410fb
Show file tree
Hide file tree
Showing 27 changed files with 245 additions and 83 deletions.
10 changes: 10 additions & 0 deletions clock/README.md
@@ -0,0 +1,10 @@
# Clock

A widget-like application that provides a world clock, an alarm, a timer and a stopwatch.

## APIs

* [Sync Storage API](http://developer.chrome.com/trunk/apps/storage.html)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)

10 changes: 10 additions & 0 deletions context-menu/README.md
@@ -1,3 +1,13 @@
# Context menus

Sample that shows how to use the [context menu API](http://developer.chrome.com/trunk/apps/contextMenus.html) in an app to achieve per-window menus.

Context menus are normally global to the entire app, and thus all windows would have the same menu. This sample uses a `focus` event handler in each window to detect when a window is brought to the foreground. When it is, the contents of the context menu are updated with that window's commands. The `chrome.contextMenus.onClicked` event handler also only handles events that occur in that window.

## APIs

* [Context menu API](http://developer.chrome.com/trunk/apps/contextMenus.html)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)


11 changes: 11 additions & 0 deletions diff/README.md
@@ -0,0 +1,11 @@
# Diff

A non-trivial application to diff two files choosen by the user. This app shows how you can open for reading and for writing files in the user's computer, as long as the file was explicitly selected by the user. It uses the Filesystem API, which is an extension of the HTML5 Filesystem API.

## APIs

* [Local Storage API](http://developer.chrome.com/trunk/apps/storage.html) to save history of selected files
* [Filesystem API](http://developer.chrome.com/trunk/apps/app_storage.html) to allow the user to pick arbitrary files from the disk and save them back.
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)

9 changes: 9 additions & 0 deletions explicit-webintents/README.md
@@ -1,3 +1,12 @@
# Explicit WebIntents

This sample shows how two apps ("ping" and "pong") can communicate via explicit web intents without direct user involvement.

Install both "ping" and "pong". Launch either app, and press the "Dispatch intent" button. The other app will be launched (if it's not running already), and the intent data will be delivered to its background page via the `onLaunched` event (and then in turn to its window). The other app will reply, and the reply will be displayed in the window of the app that sent the intent.

## APIs

* [WebIntents](http://developer.chrome.com/apps/app_intents.html)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)

9 changes: 9 additions & 0 deletions frameless-window/README.md
@@ -0,0 +1,9 @@
# Frameless window

A sample application to showcase how you can use frame:'none' windows to allow total customization of the window's real state. At beginning, the window is open with no titlebar. As long as you check one of the titlebars, it is added to the appropriate position. Notice that the added titlebars are the only parts of the window that allows dragging. This is achieved through a special CSS property applied to what is NOT to be draggable (in this case, the whole content of the window, except the titlebars): `-webkit-widget-region: region(control rectangle);`

## APIs

* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)

30 changes: 14 additions & 16 deletions hello-world-sync/README.md
Expand Up @@ -5,22 +5,20 @@ Use chrome.storage.sync to share small chunks of data among all of your Chrome d
Important: needs "key" in manifest.json to support testing outside of CWS, so that sync storage is shared among different instances.


```javascript
// app.js
chrome.storage.sync.set({"myValue": newValue}, mycallback);
...
chrome.storage.onChanged.addListener(
function(changes, namespace) {
// do something
}
);
...
chrome.storage.sync.get("myValue",
function(val) {
// do something
}
);
```
// app.js
chrome.storage.sync.set({"myValue": newValue}, mycallback);
...
chrome.storage.onChanged.addListener(
function(changes, namespace) {
// do something
}
);
...
chrome.storage.sync.get("myValue",
function(val) {
// do something
}
);

## APIs

Expand Down
12 changes: 12 additions & 0 deletions identity/README.md
@@ -0,0 +1,12 @@
# Identity

A sample application that uses the Identity API to request identification information of the logged in user and present this info on the screen. If the user has a profile picture, a XMLHttpRequest2 request is also sent to grab the image and show it in the app.

This app uses the getAuthToken flow of the Identity API, so it only works with Google accounts. If you want to identify the user in a non-Google OAuth2 flow, you should use the launchWebAuthFlow method instead.

## APIs

* [Identity](http://developer.chrome.com/trunk/apps/app.identity.html)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)

13 changes: 0 additions & 13 deletions ioio/README

This file was deleted.

13 changes: 13 additions & 0 deletions ioio/README.md
@@ -0,0 +1,13 @@
# IOIO Bluetooth device

Very simple IOIO client. Tested with [this hardware](http://www.adafruit.com/blog/2012/06/15/new-product-ioio-mint-portable-android-development-kit/)

The constants and information about the protocol was taken from https://github.com/ytai/ioio/wiki/

## Caveats:
* The bluetooth API is only available on Chrom(e|ium)OS
* Resource clean-up isn't happening properly yet: you will likely have to disable/enable bluetooth between runs of the program or the connection will fail

## APIs

* [Bluetooth](http://developer.chrome.com/apps/experimental.bluetooth.html)
11 changes: 11 additions & 0 deletions mdns-browser/README.md
@@ -0,0 +1,11 @@
# mDNS browser

This is a non-trivial sample which uses the UDP multicast support in Chrome Packaged Apps to browse mDNS servers. mDNS protocol is usually used for home appliance devices, like the Apple's Bonjour. Read more about the mDNS protocol at this [Wikipedia's article](http://en.wikipedia.org/wiki/Multicast_DNS)


## APIs

* [UDP Network](http://developer.chrome.com/trunk/apps/app_network.html#udp)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)

10 changes: 10 additions & 0 deletions mini-code-edit/README.md
@@ -0,0 +1,10 @@
# Mini code editor

A non-trivial sample with basic features of a code editor, like syntax detection and syntax highlight. If also uses the extended FileSystem API that allows a user to select files from the disk so the app can read and write to that file.

## APIs

* [chrome.fileSystem](http://developer.chrome.com/trunk/apps/fileSystem.html)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)

9 changes: 9 additions & 0 deletions serial-control-signals/README.md
@@ -0,0 +1,9 @@
# Serial Control Signals

This sample demonstrates how you can send and receive control signals (DTR, RTS, DCD and CTS) to/from a serial port.

## APIs

* [Serial API](http://developer.chrome.com/trunk/apps/app.hardware.html#serial)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)
15 changes: 10 additions & 5 deletions serial/adkjs/README.md
@@ -1,10 +1,15 @@
adkjs
=====
# ADK kit in Javascript

This demo is composed of two parts and require a ADK 1.0 hardware (Arduino board+shield shipped at Google I/O 2011 to demonstrate Android hardware integration).
This demo is composed of two parts and require a ADK 1.0 hardware (Arduino board+shield shipped at Google I/O 2011) to demonstrate Android hardware integration.

The demo simulates the same visual interface of the Android application, but in HTML5. There are UI widgets to control the servo motors, led lights and relays, and it gets sensors and buttons events.

In the firmware directory, there is the Arduino app you must upload. We could not use exactly the same arduino code from the original Android ADK because it uses a USB port where the board is the USB host, and that woudl conflict with the computer USB port that is always the host. Anyway, just upload this arduino code to the board and you are set.
In the firmware directory, there is the Arduino app you must upload. We could not use exactly the same arduino code from the original Android ADK because it uses a USB port where the board is the USB host, and that woudl conflict with the computer USB port that is always the host. Upload the arduino firmware code to the board and you are set.

In the app directory, you will find the packaged Chrome app.
In the app directory, you will find the Chrome Packaged App.

## APIs

* [Serial API](http://developer.chrome.com/trunk/apps/app.hardware.html#serial)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)
8 changes: 8 additions & 0 deletions serial/ledtoggle/README.md
@@ -1,3 +1,5 @@
# Arduino LED toggle

Note: on Mac OS X Lion, it's necessary to update USB Serial drivers:
http://geekscape.posterous.com/mac-os-x-17-lion-upgrading-ftdi-usb-serial-dr

Expand All @@ -11,3 +13,9 @@ state of an LED connected to an Arduino.

Future version: use the standard Firmata sketch and build a JS firmata driver
for Chrome packaged apps.

## APIs

* [Serial API](http://developer.chrome.com/trunk/apps/app.hardware.html#serial)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)
10 changes: 10 additions & 0 deletions servo/README.md
@@ -1,2 +1,12 @@
# Arduino servo control

Note: on Mac OS X Lion, it's necessary to update USB Serial drivers:
http://geekscape.posterous.com/mac-os-x-17-lion-upgrading-ftdi-usb-serial-dr

This app displays a slider that, when dragged, causes a servo attached to an Arduino to move. The Arduino sketch is included and should be uploaded to the Arduino.

## APIs

* [Serial API](http://developer.chrome.com/trunk/apps/app.hardware.html#serial)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)
6 changes: 3 additions & 3 deletions singleton/README.md
@@ -1,9 +1,9 @@
# Hello World
# Singleton window

Sample that shows how to use the [windowing API](http://developer.chrome.com/trunk/apps/appWindow.html) in an app to have a "singleton" window app.
Sample that shows how to use the [window API](http://developer.chrome.com/trunk/apps/appWindow.html) in an app to have a "singleton" window app.

The app keeps track of its window in the background page. If none exists, or if it's closed, it creates a new one. Otherwise it re-focuses the existing one via `chrome.app.window.focus()`.

## APIs

* [Windowing](http://developer.chrome.com/trunk/apps/app.window.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)
10 changes: 10 additions & 0 deletions storage/README.md
@@ -0,0 +1,10 @@
# Storage simple test

A very basic application that demonstrates the Filesystem API. It allows you to request a filesystem, write a sample file to it and query how many bytes are available.

## APIs

* [Filesystem](http://developer.chrome.com/trunk/apps/app_storage.html)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)

10 changes: 10 additions & 0 deletions text-editor/README.md
@@ -0,0 +1,10 @@
# Code editor

A non-trivial sample with basic features of a code editor, like language detection and syntax highlight. If also uses the extended FileSystem API that allows a user to select files from the disk so the app can read and write to that file. This sample is very similar to the [mini-code-editor](https://github.com/GoogleChrome/chrome-app-samples/tree/master/mini-code-edit)

## APIs

* [chrome.fileSystem](http://developer.chrome.com/trunk/apps/fileSystem.html)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)

21 changes: 0 additions & 21 deletions udp/README

This file was deleted.

31 changes: 31 additions & 0 deletions udp/README.md
@@ -0,0 +1,31 @@
# A simple UDP echo client

------------------------------

[127.0.0.1:3007 ] [Connect]

**o
..
.



------------------------------

Connects to a UDP echo server at the given address.

Each little dot represents a echo request.
When the request receives a reply, it shoots away and blows up.
When a request doesn't receive a reply, it grows into a big ball and blows up.

The dots gravitate towards each other for extra spiffiness.

### Server side

In the `server` directory, you will find a Node echo server that intentionally drops some packets to simulate a real network. Run this server before, so you can connect the client (Chrome Packaged App) to it.

## APIs

* [UDP Network](http://developer.chrome.com/trunk/apps/app_network.html#udp)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)
12 changes: 9 additions & 3 deletions usb/knob/README.md
@@ -1,3 +1,9 @@
NOTE
----
This demo interfaces with a Griffin PowerMate device, reading its position and displaying it via a Chrome logo. It does not currently work on Mac OS X, since on that platform the OS claims the PowerMate is an HID device, and does not allow raw USB access to it.
# Griffin PowerMate knob

This demo interfaces with a [Griffin PowerMate](http://en.wikipedia.org/wiki/Griffin_PowerMate) device, reading its position and displaying it via a Chrome logo. It does not currently work on Mac OS X, since on that platform the OS claims the PowerMate is an HID device, and does not allow raw USB access to it.

## APIs

* [USB raw access](http://developer.chrome.com/trunk/apps/app_hardware.html#usb)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)
15 changes: 6 additions & 9 deletions webgl/README.md
Expand Up @@ -2,20 +2,17 @@

This is the most basic application that one can create, using WebGL capabilities. It loads a (cool) 3D model from a JSON file and allows for model rotation and camera zooming, based on mouse movements.

This sample uses the frameless window, an experimental feature.
This sample uses the frameless window:

```javascript
// Main.js
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html',
{frame: 'none', width: 500, height: 400});
});
```
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html',
{frame: 'none', width: 500, height: 400});
});

## APIs

* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)

## External libs

Expand Down
10 changes: 10 additions & 0 deletions webintents/README.md
@@ -0,0 +1,10 @@
# WebIntent handler

This sample is an image editor that, when launched as a normal app, works as a simple image editor. However, it also registers itself as an image editor WebIntent handler. So, if you go to any other site or app that triggers an edit image intent, this app will be presented as an option.

## APIs

* [WebIntents](http://developer.chrome.com/apps/app_intents.html)
* [Runtime](http://developer.chrome.com/trunk/apps/app.runtime.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)

3 changes: 1 addition & 2 deletions webintents/js/background.js
Expand Up @@ -7,8 +7,7 @@ chrome.app.runtime.onLaunched.addListener(function(data) {
width: 700,
height: 473,
minWidth: 700,
minHeight: 473,
frame: 'none'
minHeight: 473
}, function(win) {
mainWindow = win;
if (data && data.intent && data.intent.type.indexOf('image') === 0)
Expand Down
4 changes: 2 additions & 2 deletions windows/README.md
@@ -1,9 +1,9 @@
# Copycat Window

Sample that shows how to use the [windowing API](http://developer.chrome.com/trunk/apps/app.window.html) to create a window with a custom frame and manipulate its properties.
Sample that shows how to use the [window API](http://developer.chrome.com/trunk/apps/app.window.html) to create a window with a custom frame and manipulate its properties.

The app creates two windows, an "original" window and a "copycat" window. The copycat window mimics the position and minimize state of the original window, but it displays itself in an inverted fashion.

## APIs

* [Windowing](http://developer.chrome.com/trunk/apps/app.window.html)
* [Window](http://developer.chrome.com/trunk/apps/app.window.html)
9 changes: 0 additions & 9 deletions zephyr_hxm/README

This file was deleted.

0 comments on commit 2b410fb

Please sign in to comment.