README.md
1
2Android WearNotifications Sample
3===================================
4
5Sample demonstrates best practices for using NotificationStyle Notifications (Inbox,
6 BigPicture, BigText, and Messaging) for both Mobile apps and native/local Android Wear
7 apps. It also covers Notifications on Wear 1.+ and Wear 2.0.
8
9Introduction
10------------
11
12Steps for trying out the sample:
13* Compile and install the mobile app onto your mobile device or emulator (for mobile
14scenario).
15* Compile and install the wearable app onto your Wear device or emulator (for Wear
16scenario).
17
18This sample demonstrate best practices for using [NotificationStyle][1]
19[Notifications][2] for two scenarios:
20
211. Launching Notifications from a Mobile app WITHOUT a native Android Wear app.
22Notifications appear both on mobile and Wear (bridged to appear like a local/native
23Wear app).
24
252. Launching Notifications from a Native/Local Android Wear app. Notifications only
26appear on Wear device.
27
28The Mobile and Wear apps demonstrate [BigTextStyle][3], [BigPictureStyle][4],
29[InboxStyle][5], and [MessagingStyle][6] Notifications.
30
31Although there are two apps (Mobile and Wear) running, each should be looked at as a
32separate experience. That is, neither app uses nor relies on the other.
33
34They are packaged together simply to show both scenarios in one easy sample.
35
36Both apps also cover the Notifications being displayed on Wear 1.+ and/or Wear 2.0 and
37using some of the new features of Wear 2.0 (inline actions).
38
39[1]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Style.html
40[2]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.html
41[3]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.BigTextStyle.html
42[4]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.BigPictureStyle.html
43[5]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.InboxStyle.html
44[6]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.MessagingStyle.html
45
46Pre-requisites
47--------------
48
49- Android SDK 26
50- Android Build Tools v27.0.2
51- Android Support Repository
52
53Screenshots
54-------------
55
56<img src="screenshots/mobile-1.png" height="400" alt="Screenshot"/> <img src="screenshots/mobile-2.png" height="400" alt="Screenshot"/> <img src="screenshots/wear-1.png" height="400" alt="Screenshot"/> <img src="screenshots/wear-2.png" height="400" alt="Screenshot"/>
57
58Getting Started
59---------------
60
61This sample uses the Gradle build system. To build this project, use the
62"gradlew build" command or use "Import Project" in Android Studio.
63
64Support
65-------
66
67- Google+ Community: https://plus.google.com/communities/105153134372062985968
68- Stack Overflow: http://stackoverflow.com/questions/tagged/android
69
70If you've found an error in this sample, please file an issue:
71https://github.com/googlesamples/android-WearNotifications
72
73Patches are encouraged, and may be submitted by forking this project and
74submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
75
76License
77-------
78
79Copyright 2017 The Android Open Source Project, Inc.
80
81Licensed to the Apache Software Foundation (ASF) under one or more contributor
82license agreements. See the NOTICE file distributed with this work for
83additional information regarding copyright ownership. The ASF licenses this
84file to you under the Apache License, Version 2.0 (the "License"); you may not
85use this file except in compliance with the License. You may obtain a copy of
86the License at
87
88http://www.apache.org/licenses/LICENSE-2.0
89
90Unless required by applicable law or agreed to in writing, software
91distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
92WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
93License for the specific language governing permissions and limitations under
94the License.
95