# cordova-androidwear

> Communication from your cordova application to an Android Wear application.

Latest version **1.0.2** (published 2020-07-04) · Apache 2.0 license · 0 weekly downloads

## Install

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

## 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.2 |
| Published | 2020-07-04 |
| First published | 2015-12-30 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 32.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 114 |
| Author | Trent Gardner |
| Maintainers | tgardner |
| Keywords | AndroidWear, Android, Wear, Watch, Wearble, ecosystem:cordova, cordova-android |

## Links

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

## 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.2 (latest) — 2020-07-04
- 1.0.1 — 2018-01-09
- 1.0.0 — 2015-12-30
- 0.0.3 — 2015-12-30

## README

# Cordova Android Wear Plugin

The plugin has functions that allows your app to have bidirectional communication with Android Wear Smartwatch applications and Cordova applications.

## Installation
With Cordova CLI, from npm:
```
$ cordova plugin add cordova-androidwear
$ cordova prepare
```

## Usage

1. Add the plugin to your cordova project.

2. Bundle your watch apk in your project by following the instructions in the [documentation](https://developer.android.com/training/wearables/apps/packaging.html#PackageManually).

## Example
  ```javascript
  AndroidWear.onConnect(function(e) {
      alert("Connection Successfully Established - handle: " + e.handle);

      AndroidWear.onDataReceived(e.handle, function(e) {
          alert("Data received - handle: " + e.handle + " data: "+ e.data);
      });

      AndroidWear.sendData(e.handle, "Hello From Cordova!");
  });
  ```

A slightly more complete example is [available](https://github.com/tgardner/cordova-androidwear-example).

## Notes

Please note with the introduction of Play Services 11.8.0, there's been a breaking change, requiring you to specify a capability in your wearable project of `cordova_messaging`. This is required for connect / disconnect sensitivity.
  ```xml
  <resources>
	  <string-array name="android_wear_capabilities" translatable="false">
		  <item>cordova_messaging</item>
	  </string-array>
  </resources>
  ```

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