1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright 2013 The Android Open Source Project
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9     http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<sample>
18    <name>AlwaysOn</name>
19    <group>Wearable</group>
20    <package>com.example.android.wearable.wear.alwayson</package>
21
22    <dependency_wearable>com.google.android.support:wearable:1.3.0</dependency_wearable>
23
24    <provided_dependency_wearable>com.google.android.wearable:wearable:1.0.0</provided_dependency_wearable>
25
26    <targetSdkVersionWear>22</targetSdkVersionWear>
27
28    <strings>
29        <intro>
30            <![CDATA[
31            Demonstrates a native Android Wear app using ambient screen support.
32            ]]>>
33        </intro>
34    </strings>
35
36    <template src="base-build" />
37    <template src="Wear" />
38
39    <!-- Include common code modules by uncommenting them below. -->
40    <!-- common src="logger"/ -->
41
42    <metadata>
43        <status>PUBLISHED</status>
44        <categories>Wearable</categories>
45        <technologies>Android</technologies>
46        <languages>Java</languages>
47        <solutions>Mobile</solutions>
48        <level>INTERMEDIATE</level>
49        <screenshots>
50            <img>screenshots/1-main-active.png</img>
51            <img>screenshots/2-main-ambient.png</img>
52            <img>screenshots/3-main-active-round.png</img>
53            <img>screenshots/4-main-ambient-round.png</img>
54        </screenshots>
55        <api_refs>
56            <android>android.support.wearable.activity.WearableActivity</android>
57        </api_refs>
58        <description>
59            <![CDATA[
60A basic sample showing how to support ambient mode for native Android Wear apps.
61]]>
62        </description>
63
64        <intro>
65            <![CDATA[
66[WearableActivity][1] offers methods for supporting your native app staying on the screen when the Wear device enters ambient mode.
67
68This example extends [WearableActivity][1] and overrides onEnterAmbient, onUpdateAmbient, and onExitAmbient to allow the simple native Wear app to support ambient mode.
69
70In ambient mode, this app follows best practices by keeping most pixels black, avoiding large blocks of white pixels, using only black and white, and disabling anti-aliasing (following the [design guidelines for Watch Faces][2]).
71
72In addition and most importantly, the app sleeps while in ambient mode for 20 seconds between any updates to conserving battery life (processor allowed to sleep). If you can hold off on updates for a full minute, you can throw away the Handler and just use onUpdateAmbient to save even more battery life.
73
74As always, you will still want to apply the [performance guidelines][3] outlined in the Watch Faces documention to your app.
75
76[1]: http://developer.android.com/reference/android/support/wearable/activity/WearableActivity.html
77[2]: https://developer.android.com/training/wearables/watch-faces/designing.html#DesignGuidelines
78[3]: https://developer.android.com/training/wearables/watch-faces/performance.html
79]]>
80        </intro>
81    </metadata>
82</sample>
83