blob: 9eb6378ac73a344dd92c5172308ef43a3e067bfd [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
Copyright 2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
This simple app demonstrates how to embed a wearable app into a phone app.
<template src="base"/>
<template src="Wear"/>
This simple app demonstrates how to embed a wearable app into a phone app.
Wearable apps can be installed directly onto Android Wear devices during development, using either a direct ADB
connection or ADB-over-Bluetooth. However, when releasing your app to end users, you must package your
wearable APK inside of a traditional APK for distribution via a paired phone.
When end users install this APK onto their phone, the wearable APK will be automatically detected, extracted, and pushed
to their any paired wearable devices.
This sample demonstrates how to properly package a wearable app for release in this manner. The wearable app is inside
the `Wearable` directory, and the phone app (which will be used as a container for distribution) is the `Application`
directory. There is nothing special about these apps, other than the `wearApp` dependency in the (host) phone app's
`build.gradle` file:
dependencies {
compile ''
wearApp project(':Wearable')
This dependency will automatically package the wearable APK during a **release build** (e.g. using the "Build > Generate
Signed APK..." command in Android Studio). Note that this packaging is **not** performed for debug builds for
performance reasons. During development, your wearable and phone apps must still be pushed individually to their
respective devices using an ADB connection.