README.md
1Android EmbeddedApp Sample
2===================================
3
4This simple app demonstrates how to embed a wearable app into a phone app.
5
6Introduction
7------------
8
9Wearable apps can be installed directly onto Android Wear devices during development, using either a direct ADB
10connection or ADB-over-Bluetooth. However, when releasing your app to end users, you must package your
11wearable APK inside of a traditional APK for distribution via a paired phone.
12
13When end users install this APK onto their phone, the wearable APK will be automatically detected, extracted, and pushed
14to their any paired wearable devices.
15
16This sample demonstrates how to properly package a wearable app for release in this manner. The wearable app is inside
17the `Wearable` directory, and the phone app (which will be used as a container for distribution) is the `Application`
18directory. There is nothing special about these apps, other than the `wearApp` dependency in the (host) phone app's
19`build.gradle` file:
20
21```groovy
22dependencies {
23 compile 'com.google.android.gms:play-services-wearable:6.5.+'
24 wearApp project(':Wearable')
25}
26```
27
28This dependency will automatically package the wearable APK during a **release build** (e.g. using the "Build > Generate
29Signed APK..." command in Android Studio). Note that this packaging is **not** performed for debug builds for
30performance reasons. During development, your wearable and phone apps must still be pushed individually to their
31respective devices using an ADB connection.
32
33Pre-requisites
34--------------
35
36- Android SDK v21
37- Android Build Tools v21.1.1
38- Android Support Repository
39
40Screenshots
41-------------
42
43<img src="screenshots/embedded_wearable_app.png" height="400" alt="Screenshot"/> <img src="screenshots/phone_app.png" height="400" alt="Screenshot"/>
44
45Getting Started
46---------------
47
48This sample uses the Gradle build system. To build this project, use the
49"gradlew build" command or use "Import Project" in Android Studio.
50
51Support
52-------
53
54- Google+ Community: https://plus.google.com/communities/105153134372062985968
55- Stack Overflow: http://stackoverflow.com/questions/tagged/android
56
57If you've found an error in this sample, please file an issue:
58https://github.com/googlesamples/android-EmbeddedApp
59
60Patches are encouraged, and may be submitted by forking this project and
61submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
62
63License
64-------
65
66Copyright 2014 The Android Open Source Project, Inc.
67
68Licensed to the Apache Software Foundation (ASF) under one or more contributor
69license agreements. See the NOTICE file distributed with this work for
70additional information regarding copyright ownership. The ASF licenses this
71file to you under the Apache License, Version 2.0 (the "License"); you may not
72use this file except in compliance with the License. You may obtain a copy of
73the License at
74
75http://www.apache.org/licenses/LICENSE-2.0
76
77Unless required by applicable law or agreed to in writing, software
78distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
79WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
80License for the specific language governing permissions and limitations under
81the License.
82