<commit_before>googleglass-phonegap-example
============================

Example Phonegap project that can be imported to Eclipse and exported as .apk file for Google Glass. The example JavaScript includes touchpad events, which are [KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent)s with the Phonegap API. In addition, the example also shows how you can use the Phonegap API to access accelerometer data.

##Prerequisites
1. Make sure [Glass Debugging](https://developers.google.com/glass/gdk) is turned on
2. Connect your Glass via **USB** to your computer
3. On your mobile device, turn on Glass **screencast**
4. On your computer, [Install Phonegap] (https://dl.dropboxusercontent.com/u/348446/trainings/android.html)

##Directions
1. Clone this ````<googleglass-phonegap-example>```` repository
2. In Eclipse, **import** the ````<googleglass-phonegap-example>/example/```` directory
3. Download and install [Android Debug Bridge](http://developer.android.com/tools/help/adb.html) (adb)
4. In Terminal, ````cd```` to ````<adt-bundle...>/sdk/platform-tools````
   * run ````./android update adb````
   * run ````./adb kill-server````
   * run ````./adb start-server````
   * run ````./adb devices````
   * make sure Glass Serial Number is detected
5. In Eclipse, right-click on the example project and hit 'run example'. You should see an option to upload to your Glass.
6. Make changes to JavaScript, HTML, and CSS in the ````<googleglass-phonegap-example>/example/assets/www```` directory

##References
* [Phonegap Docs](http://docs.phonegap.com/en/2.6.0/guide_getting-started_index.md.html)
* [Android Debug Bridge](http://developer.android.com/tools/help/adb.html) aka 'ADB'
* [Glass GDK](https://developers.google.com/glass/gdk)

![Screenshot of accelerometer data](/screenshot_accel_data.png)]<commit_msg>clarification of Phonegap API events as well as caption for image<commit_after>googleglass-phonegap-example
============================

Example Phonegap project that can be imported to Eclipse and exported as .apk file for Google Glass. The JavaScript includes touchpad events and accelerometer events via the Phonegap API.

##Prerequisites
1. Make sure [Glass Debugging](https://developers.google.com/glass/gdk) is turned on
2. Connect your Glass via **USB** to your computer
3. On your mobile device, turn on Glass **screencast**
4. On your computer, [Install Phonegap] (https://dl.dropboxusercontent.com/u/348446/trainings/android.html)

##Directions
1. Clone this ````<googleglass-phonegap-example>```` repository
2. In Eclipse, **import** the ````<googleglass-phonegap-example>/example/```` directory
3. Download and install [Android Debug Bridge](http://developer.android.com/tools/help/adb.html) (adb)
4. In Terminal, ````cd```` to ````<adt-bundle...>/sdk/platform-tools````
   * run ````./android update adb````
   * run ````./adb kill-server````
   * run ````./adb start-server````
   * run ````./adb devices````
   * make sure Glass Serial Number is detected
5. In Eclipse, right-click on the example project and hit 'run example'. You should see an option to upload to your Glass.
6. Make changes to JavaScript, HTML, and CSS in the ````<googleglass-phonegap-example>/example/assets/www```` directory

##References
* [Phonegap Docs](http://docs.phonegap.com/en/2.6.0/guide_getting-started_index.md.html)
* [Android Debug Bridge](http://developer.android.com/tools/help/adb.html) aka 'ADB'
* [Glass GDK](https://developers.google.com/glass/gdk)

Screenshot of Glass accelerometer data:
![Google Glass accelerometer data via Phonegap](/screenshot_accel_data.png)
{'fraction_non_alphanumeric': 0.16141514648977334, 'fraction_numerical': 0.010503040353786623, 'mean_word_length': 4.8845528455284555, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 7, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '430814', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1077, 'n_words': 352}