• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright 2015 Google Inc. All rights reserved.
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>XYZTouristAttractions</name>
19    <group>Wearable</group>
20    <package>com.example.android.xyztouristattractions</package>
21    <minSdk>18</minSdk>
22    <targetSdkVersion>25</targetSdkVersion>
23    <targetSdkVersionWear>25</targetSdkVersionWear>
24
25    <wearable>
26        <has_handheld_app>true</has_handheld_app>
27    </wearable>
28
29    <dependency>com.google.android.gms:play-services-location</dependency>
30
31    <dependency>com.google.maps.android:android-maps-utils:0.3.4</dependency>
32    <dependency>com.github.bumptech.glide:glide:3.6.1</dependency>
33    <dependency>com.android.support:appcompat-v7:25.3.1</dependency>
34    <dependency>com.android.support:recyclerview-v7:25.3.1</dependency>
35    <dependency>com.android.support:design:25.3.1</dependency>
36    <dependency_wearable>com.google.android.gms:play-services-maps</dependency_wearable>
37    <dependency_shared>com.android.support:support-v13:25.3.1</dependency_shared>
38    <dependency_shared>com.google.android.gms:play-services-wearable</dependency_shared>
39    <dependency_shared>com.google.android.gms:play-services-maps</dependency_shared>
40    <dependency_shared>com.google.maps.android:android-maps-utils:0.3.4</dependency_shared>
41
42
43
44    <strings>
45        <intro>
46<![CDATA[
47This sample aims to be as close to a real world example of a mobile
48and Wear app combination as possible. It has a more refined design
49and also provides a practical example of how a mobile app would
50interact and communicate with its wear counterpart.
51
52The app itself is modeled after a hypothetical tourist attractions
53app that notifies the user when they are in close proximity to
54notable points of interest.
55
56The Wear component loads a full wearable app that shows images,
57summary information and provides quick actions for nearby tourist
58attractions in a GridViewPager UI component.
59]]>
60        </intro>
61    </strings>
62
63    <template src="base" />
64    <template src="WearPlusShared"/>
65
66    <metadata>
67        <!-- Values: {DRAFT | PUBLISHED | INTERNAL | DEPRECATED | SUPERCEDED} -->
68        <status>PUBLISHED</status>
69        <!-- See http://go/sample-categories for details on the next 4 fields. -->
70        <categories>Wearable, Location, Notification</categories>
71        <technologies>Android</technologies>
72        <languages>Java</languages>
73        <solutions>Mobile</solutions>
74        <!-- Values: {BEGINNER | INTERMEDIATE | ADVANCED | EXPERT} -->
75        <level>INTERMEDIATE</level>
76        <!-- Dimensions: 512x512, PNG fomrat -->
77        <icon>screenshots/icon-web.png</icon>
78        <!-- Path to screenshots. Use <img> tags for each. -->
79        <screenshots>
80            <img>screenshots/composite-1.png</img>
81        </screenshots>
82        <!-- List of APIs that this sample should be cross-referenced under. Use <android>
83        for fully-qualified Framework class names ("android:" namespace).
84
85        Use <ext> for custom namespaces, if needed. See "Samples Index API" documentation
86        for more details. -->
87        <api_refs>
88            <android>android.support.v7.appcompat</android>
89            <android>android.support.v7.widget.RecyclerView</android>
90            <android>android.support.v7.widget.GridLayoutManager</android>
91            <android>android.support.v4.content.ContextCompat</android>
92            <android>android.support.v4.app.ActivityCompat</android>
93            <android>android.support.design.widget.FloatingActionButton</android>
94            <android>android.support.design.widget.CoordinatorLayout</android>
95            <android>com.google.android.gms.common.api.GoogleApiClient</android>
96            <android>com.google.android.gms.wearable.Wearable</android>
97            <android>com.google.android.gms.wearable.DataApi</android>
98            <android>com.google.android.gms.wearable.NodeApi</android>
99            <android>com.google.android.gms.wearable.WearableListenerService</android>
100            <android>com.google.android.gms.location.LocationServices.GeofencingApi</android>
101            <android>com.google.android.gms.location.LocationServices.FusedLocationApi</android>
102            <android>android.support.wearable.view.DismissOverlayView</android>
103            <android>android.support.wearable.view.DotsPageIndicator</android>
104            <android>android.support.wearable.view.GridViewPager</android>
105            <android>android.support.wearable.activity.ConfirmationActivity</android>
106            <android>android.support.wearable.view.CardFrame</android>
107            <android>android.support.wearable.view.CardScrollView</android>
108            <android>android.support.wearable.view.GridPagerAdapter</android>
109            <android>android.support.wearable.view.WatchViewStub</android>
110            <android>android.support.wearable.view.ActionPage</android>
111        </api_refs>
112
113        <!-- 1-3 line description of the sample here.
114
115            Avoid simply rearranging the sample's title. What does this sample actually
116            accomplish, and how does it do it? -->
117        <description>
118This sample aims to be as close to a real world example of a mobile
119and Wear app combination as possible. It has a more refined design
120and also provides a practical example of how a mobile app would
121interact and communicate with its wear counterpart.
122
123The app itself is modeled after a hypothetical tourist attractions
124app that notifies the user when they are in close proximity to
125notable points of interest.
126
127The Wear component shows tourist attraction images and summary
128information, and provides quick actions for nearby tourist
129attractions in a [GridViewPager](http://developer.android.com/reference/android/support/wearable/view/GridViewPager.html)
130UI component.
131        </description>
132
133        <!-- Multi-paragraph introduction to sample, from an educational point-of-view.
134        Makrdown formatting allowed. This will be used to generate a mini-article for the
135        sample on DAC. -->
136        <intro>
137<![CDATA[
138Steps for trying out this sample:
139* Compile and install the mobile app onto your mobile device or emulator.
140* Compile and install the wearable app onto your Wear device or emulator.
141(**Note:** wearable apps are not automatically pushed from your mobile device
142unless you build a production release, see [here][22] for more info).
143* Start the mobile app and use the overflow menu options to test either a
144notification enhanced for Wear, or the full wearable application (unless
145you're physically in Sydney in which case the geofence should trigger
146automatically). Note that the first time you trigger either the notification
147or the wearable app it may take 20-30 seconds to show up as it needs to
148transfer the image assets to the wearable (in practice this delay won't be
149noticeable to users as they will only be notified once the data has been sent).
150
151This sample aims to demonstrate a number of different Android APIs and concepts
152relating to [Android Wear][1] and location using [Google Play Services][2]:
153* Trigger a mobile notification that uses [WearableExtender][3] to customize the
154display on the wearable
155* Transmit data from the mobile app to the wearable (including binary blobs
156such as photos) using the [Wearable DataApi][4]
157* Synchronize notification dismissal across mobile and wearable apps via the
158[Wearable MessageApi][5]
159* Trigger actions on the mobile app via the wearable app (eg. start walking
160navigation) via the [Wearable MessageApi][5]
161* Locate the user via the [Google Location APIs][6] and the
162[FusedLocationProviderApi][7]
163* Set up and trigger location [geofences][8] using the
164[Google Location APIs][6]
165
166The sample also focuses on providing a simple, yet clean design and UI for both
167mobile and wearable apps with an extra level of visual polish compared to a
168traditional code sample.
169
170Some of the UI widgets and design patterns used in the mobile app include:
171* Use of Material theme including definition of primary and accent colors
172* [AppCompat][9] usage for Material theme backward compatibility
173* Metrics and keylines based on the [Material guidelines][10]
174* Window content and activity transitions based on the
175[Material guidelines][11]
176* Use of the [RecyclerView][12] widget
177* CoordinatorLayout[23] and FloatingActionButton[24] from the Design Support library[25]
178* Material animations such as activity and shared element transitions
179
180The wearable app uses a number of techniques and UI widgets as well:
181* Full screen app built off [GridViewPager][13] and [DotsPageIndicator][14]
182* Support for square and round screens (with and without insets) using
183[WatchViewStub][15] and [OnApplyWindowInsetsListener][16]
184* Use of a variety of other widgets from the [Wearable UI Library][17]
185([DismissOverlayView][18], [ConfirmationActivity][19],
186[CardScrollView][20], [CircledImageView][21], [ActionPage][26])
187
188[1]: http://developer.android.com/wear/
189[2]: https://developer.android.com/google/play-services/
190[3]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.WearableExtender.html
191[4]: https://developer.android.com/reference/com/google/android/gms/wearable/DataApi.html
192[5]: https://developer.android.com/reference/com/google/android/gms/wearable/MessageApi.html
193[6]: https://developer.android.com/google/play-services/location.html
194[7]: https://developer.android.com/reference/com/google/android/gms/location/FusedLocationProviderApi.html
195[8]: https://developer.android.com/reference/com/google/android/gms/location/Geofence.html
196[9]: https://developer.android.com/tools/support-library/features.html#v7-appcompat
197[10]: http://www.google.com/design/spec/layout/metrics-keylines.html
198[11]: http://www.google.com/design/spec/animation/meaningful-transitions.html
199[12]: https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html
200[13]: http://developer.android.com/reference/android/support/wearable/view/GridViewPager.html
201[14]: http://developer.android.com/reference/android/support/wearable/view/DotsPageIndicator.html
202[15]: http://developer.android.com/reference/android/support/wearable/view/WatchViewStub.html
203[16]: http://developer.android.com/reference/android/view/View.OnApplyWindowInsetsListener.html
204[17]: https://developer.android.com/training/wearables/apps/layouts.html#UiLibrary
205[18]: http://developer.android.com/reference/android/support/wearable/view/DismissOverlayView.html
206[19]: http://developer.android.com/reference/android/support/wearable/activity/ConfirmationActivity.html
207[20]: http://developer.android.com/reference/android/support/wearable/view/CardScrollView.html
208[21]: http://developer.android.com/reference/android/support/wearable/view/CircledImageView.html
209[22]: https://developer.android.com/training/wearables/apps/creating.html#Install
210[23]: https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.html
211[24]: https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html
212[25]: http://android-developers.blogspot.com/2015/05/android-design-support-library.html
213[26]: http://developer.android.com/reference/android/support/wearable/view/ActionPage.html
214]]>
215        </intro>
216    </metadata>
217</sample>
218