# cordova-galaxygear

> Allows communication with Samsung Gear 2 Series Tizen applications and Cordova applications.

Latest version **1.0.0** (published 2018-01-17) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install cordova-galaxygear
pnpm add cordova-galaxygear
yarn add cordova-galaxygear
bun add cordova-galaxygear
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-01-17 |
| First published | 2015-12-30 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Trent Gardner |
| Maintainers | tgardner |
| Keywords | GalaxyGear, Android, Samsung, Gear, Watch, Wearble, ecosystem:cordova, cordova-android |

## Links

- npm: https://www.npmjs.com/package/cordova-galaxygear
- Repository: https://github.com/tgardner/cordova-galaxygear
- Homepage: https://github.com/tgardner/cordova-galaxygear#readme
- Issues: https://github.com/tgardner/cordova-galaxygear/issues
- npm.io page: https://npm.io/package/cordova-galaxygear

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-01-17
- 0.0.3 — 2015-12-31
- 0.0.2 — 2015-12-30

## README

# Cordova Galaxy Gear Plugin

The plugin has functions that allows your app to have bidirectional communication with Samsung Gear 2 Series Tizen  applications and Cordova applications.

It supports the various Android Samsung models listed [here](http://www.samsung.com/global/microsite/gear/gear2_features.html).

## Installation
With Cordova CLI, from npm:
```
$ cordova plugin add cordova-galaxygear
$ cordova prepare
```

## Usage

1. Install the plugin in your Cordova project.

2. Add a `res/xml/assessoryservices.xml` file to your Tizen project with the following
  ````xml
  <resources>
      <application name="CordovaGearConsumer" >
          <serviceProfile
              id="/system/cordovagearprovider"
              name="cordovagearprovider"
              role="consumer"
              version="2.0" >
              
              <supportedTransports>
                  <transport type="TRANSPORT_BT" />
              </supportedTransports>
  
              <serviceChannel
                  id="104"
                  dataRate="low"
                  priority="low"
                  reliability="enable" >
              </serviceChannel>
          </serviceProfile>
      </application>
  </resources>
  ````

3. Modify the `config.xml` file in your Tizen project and add the following under the `<widget>` node
  ````xml
  <tizen:metadata key="AccessoryServicesLocation" value="res/xml/accessoryservices.xml"/>
  <tizen:privilege name="http://developer.samsung.com/privilege/accessoryprotocol"/>
  ````
A great example of this is the Hello Accessory example from the [SDK](http://developer.samsung.com/samsung-gear) 

## Example
``` javascript
GalaxyGear.onConnect(function(e) {
	alert("Connection Successfully Established - handle: " + e.handle);
	
	GalaxyGear.onDataReceived(e.handle, function(e) {
		alert("Data received - handle: " + e.handle + " data: "+ e.data);
	});
	
	GalaxyGear.sendData(e.handle, "Hello From Cordova!");
});
```

---
_Source: https://npm.io/package/cordova-galaxygear · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
