1
2Android WearMessagingApp Sample
3===================================
4
5Sample demonstrating how to build a messaging app with the following features: contacts list,
6chat list, send messages, message style notification, and sign-in with Google.
7
8Introduction
9------------
10
11Getting Started
12---------------
13
14This project demonstrates Google Sign-in. You will need to follow the setup instructions for
15integrating Google Sign-in into an Android app at the link below. Remember to use the package name
16com.example.android.wearable.wear.messaging when configuring your project and credentials, or
17otherwise modify the sample appropriately if you want to use a different package name.
18
19https://developers.google.com/identity/sign-in/android/start-integrating
20
21After you finish setting up the ___google-services.json___ file for Google Sign-in, update the
22___strings.xml___ file for the string value ___default\_web\_client\_id___ to the value for the
23OAuth web client id created.
24
25Features
26---------------
27The project demonstrates the following features:
28
29- Chat list
30- Contacts list
31- Authentication with Google
32- Sending a chat message
33- Receiving a chat message
34- Replying from a notification
35
36Each feature is contained in it's own package:
37
38- _com.example.android.wearable.wear.messaging.____chat___
39    - Displays a conversation
40    - Handles incoming messages from a mocked back end server.
41    - Replies to messages from a notification
42- _com.example.android.wearable.wear.messaging.____chatlist___
43    - Displays all of the conversations you are involved in.
44- _com.example.android.wearable.wear.messaging.____contacts___
45    - Displays a list your contacts. In this sample, the contacts are mocked out. You will want to
46    replace the backing datasource with your own contacts solution.
47- _com.example.android.wearable.wear.messaging.____mock___
48    - A local mock database.
49- _com.example.android.wearable.wear.messaging.____model___
50    - Objects that are displayed in the UI. These objects also act as entities and are persisted in
51    the mock database.
52
53
54To see other examples of Google Sign-in, check out the [Android Wear Google Sign-In Sample][1].
55
56To see other examples of notifications, check out the [Android WearNotifications Sample][2]
57
58[1]: https://github.com/googlesamples/android-WearStandaloneGoogleSignIn
59[2]: https://github.com/googlesamples/android-WearNotifications
60
61Pre-requisites
62--------------
63
64- Android SDK 27
65- Android Build Tools v27.0.2
66- Android Support Repository
67
68Screenshots
69-------------
70
71<img src="screenshots/chat_list.png" height="400" alt="Screenshot"/> <img src="screenshots/chat.png" height="400" alt="Screenshot"/> <img src="screenshots/contacts.png" height="400" alt="Screenshot"/>
72
73Getting Started
74---------------
75
76This sample uses the Gradle build system. To build this project, use the
77"gradlew build" command or use "Import Project" in Android Studio.
78
79Support
80-------
81
82- Google+ Community: https://plus.google.com/communities/105153134372062985968
83- Stack Overflow: http://stackoverflow.com/questions/tagged/android
84
85If you've found an error in this sample, please file an issue:
86https://github.com/googlesamples/android-WearMessagingApp
87
88Patches are encouraged, and may be submitted by forking this project and
89submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
90
91License
92-------
93
94Copyright 2017 The Android Open Source Project, Inc.
95
96Licensed to the Apache Software Foundation (ASF) under one or more contributor
97license agreements.  See the NOTICE file distributed with this work for
98additional information regarding copyright ownership.  The ASF licenses this
99file to you under the Apache License, Version 2.0 (the "License"); you may not
100use this file except in compliance with the License.  You may obtain a copy of
101the License at
102
103http://www.apache.org/licenses/LICENSE-2.0
104
105Unless required by applicable law or agreed to in writing, software
106distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
107WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
108License for the specific language governing permissions and limitations under
109the License.
110