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