• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright 2017 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>WearMessagingApp</name>
19    <group>Wearable</group>  <!-- This field will be deprecated in the future
20                            and replaced with the "categories" tags below. -->
21    <package>com.example.android.wearable.wear.messaging</package>
22
23    <minSdk>24</minSdk>
24    <targetSdkVersion>25</targetSdkVersion>
25    <targetSdkVersionWear>25</targetSdkVersionWear>
26
27    <dependency_wearable>com.android.support:appcompat-v7:25.3.1</dependency_wearable>
28    <dependency_wearable>com.android.support:support-v13:25.3.1</dependency_wearable>
29    <dependency_wearable>com.android.support:design:25.3.1</dependency_wearable>
30
31    <dependency_wearable>com.google.android.gms:play-services-wearable:10.2.6</dependency_wearable>
32    <dependency_wearable>com.google.android.gms:play-services-auth:10.2.6</dependency_wearable>
33
34    <dependency_wearable>com.github.bumptech.glide:glide:3.8.0</dependency_wearable>
35    <dependency_wearable>com.google.code.gson:gson:2.8.0</dependency_wearable>
36
37    <strings>
38        <intro>
39<![CDATA[
40Sample demonstrates best practices for building a messaging experience on Wear.
41]]>
42        </intro>
43    </strings>
44
45    <template src="base-build" />
46    <template src="Wear" />
47
48    <metadata>
49        <!-- Values: {DRAFT | PUBLISHED | INTERNAL | DEPRECATED | SUPERCEDED} -->
50        <status>PUBLISHED</status>
51        <!-- See http://go/sample-categories for details on the next 4 fields. -->
52        <!-- Most samples just need to udpate the Categories field. This is a comma-
53             seperated list of topic tags. Unlike the old category system, samples
54             may have multiple categories, so feel free to add extras. Try to avoid
55             simply tagging everything with "UI". :)-->
56        <categories>Wearable</categories>
57        <technologies>Android</technologies>
58        <languages>Java</languages>
59        <solutions>Mobile</solutions>
60        <!-- Values: {BEGINNER | INTERMEDIATE | ADVANCED | EXPERT} -->
61        <!-- Beginner is for "getting started" type content, or essential content.
62             (e.g. "Hello World", activities, intents)
63
64             Intermediate is for content that covers material a beginner doesn't need
65             to know, but that a skilled developer is expected to know.
66             (e.g. services, basic styles and theming, sync adapters)
67
68             Advanced is for highly technical content geared towards experienced developers.
69             (e.g. performance optimizations, custom views, bluetooth)
70
71             Expert is reserved for highly technical or specialized content, and should
72             be used sparingly. (e.g. VPN clients, SELinux, custom instrumentation runners) -->
73        <level>INTERMEDIATE</level>
74        <!-- Dimensions: 512x512, PNG fomrat -->
75        <icon>screenshots/icon-web.png</icon>
76        <!-- Path to screenshots. Use <img> tags for each. -->
77        <screenshots>
78            <img>screenshots/chat_list.png</img>
79            <img>screenshots/chat.png</img>
80            <img>screenshots/contacts.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>com.google.android.gms.auth.api.Auth</android>
89            <android>com.google.android.gms.auth.api.signin.GoogleSignInAccount</android>
90            <android>com.google.android.gms.common.api.GoogleApiClient</android>
91            <android>android.support.wearable.view.WearableRecyclerView</android>
92            <android>android.support.wearable.view.drawer.WearableActionDrawer</android>
93            <android>android.support.wearable.view.drawer.WearableDrawerLayout</android>
94            <android>android.support.v7.util.SortedList</android>
95        </api_refs>
96
97        <!-- 1-3 line description of the sample here.
98
99            Avoid simply rearranging the sample's title. What does this sample actually
100            accomplish, and how does it do it? -->
101        <description>
102<![CDATA[
103Sample demonstrating how to build a messaging app with the following features: contacts list,
104chat list, send messages, message style notification, and sign-in with Google.
105]]>
106        </description>
107
108        <!-- Multi-paragraph introduction to sample, from an educational point-of-view.
109        Makrdown formatting allowed. This will be used to generate a mini-article for the
110        sample on DAC. -->
111        <intro>
112<![CDATA[
113Getting Started
114---------------
115
116This project demonstrates Google Sign-in. You will need to follow the setup instructions for
117integrating Google Sign-in into an Android app at the link below. Remember to use the package name
118com.example.android.wearable.wear.messaging when configuring your project and credentials, or
119otherwise modify the sample appropriately if you want to use a different package name.
120
121https://developers.google.com/identity/sign-in/android/start-integrating
122
123After you finish setting up the ___google-services.json___ file for Google Sign-in, update the
124___strings.xml___ file for the string value ___default\_web\_client\_id___ to the value for the
125OAuth web client id created.
126
127Features
128---------------
129The project demonstrates the following features:
130
131- Chat list
132- Contacts list
133- Authentication with Google
134- Sending a chat message
135- Receiving a chat message
136- Replying from a notification
137
138Each feature is contained in it's own package:
139
140- _com.example.android.wearable.wear.messaging.____chat___
141    - Displays a conversation
142    - Handles incoming messages from a mocked back end server.
143    - Replies to messages from a notification
144- _com.example.android.wearable.wear.messaging.____chatlist___
145    - Displays all of the conversations you are involved in.
146- _com.example.android.wearable.wear.messaging.____contacts___
147    - Displays a list your contacts. In this sample, the contacts are mocked out. You will want to
148    replace the backing datasource with your own contacts solution.
149- _com.example.android.wearable.wear.messaging.____mock___
150    - A local mock database.
151- _com.example.android.wearable.wear.messaging.____model___
152    - Objects that are displayed in the UI. These objects also act as entities and are persisted in
153    the mock database.
154
155
156To see other examples of Google Sign-in, check out the [Wear Google Sign-In Sample][1].
157
158To see other examples of notifications, check out the [WearNotifications Sample][2]
159
160[1]: https://github.com/googlesamples/android-WearStandaloneGoogleSignIn
161[2]: https://github.com/googlesamples/android-WearNotifications
162]]>
163        </intro>
164    </metadata>
165</sample>
166