You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
7.9 KiB

<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<sample>
<name>WearNotifications</name>
<group>Wearable</group>
<package>com.example.android.wearable.wear.wearnotifications</package>
<minSdk>18</minSdk>
<compileSdkVersion>28</compileSdkVersion>
<targetSdkVersion>28</targetSdkVersion>
<minSdkVersionWear>23</minSdkVersionWear>
<compileSdkVersionWear>28</compileSdkVersionWear>
<targetSdkVersionWear>28</targetSdkVersionWear>
<multiDexEnabled>true</multiDexEnabled>
<wearable>
<has_handheld_app>true</has_handheld_app>
</wearable>
<androidX>true</androidX>
<dependency>androidx.appcompat:appcompat:1.0.2</dependency>
<dependency>androidx.cardview:cardview:1.0.0</dependency>
<dependency>com.google.android.material:material:1.0.0</dependency>
<dependency>androidx.legacy:legacy-support-v13:1.0.0</dependency>
<dependency_shared>androidx.legacy:legacy-support-v4:1.0.0</dependency_shared>
<dependency_wearable>androidx.appcompat:appcompat:1.0.2</dependency_wearable>
<dependency_wearable>androidx.wear:wear:1.0.0</dependency_wearable>
<dependency_wearable>com.google.android.material:material:1.0.0</dependency_wearable>
<dependency_wearable>androidx.legacy:legacy-support-v13:1.0.0</dependency_wearable>
<!-- Include additional dependencies here.-->
<!-- dependency>com.google.android.gms:play-services:5.0.+</dependency -->
<strings>
<intro>
<![CDATA[
Sample demonstrates best practices for Notification Styles that support Android
phone/tablets and Wear. The phone app demonstrates best practices if you
do not have a dedicated Wear app for Notifications. While the Wear app
demonstrates best practices for a standalone Wear Notification experience without
the Notifications showing on the phone/tablet.
]]>
</intro>
</strings>
<template src="base" />
<template src="WearPlusShared" />
<metadata>
<!-- Values: {DRAFT | PUBLISHED | INTERNAL | DEPRECATED | SUPERCEDED} -->
<status>PUBLISHED</status>
<!-- See http://go/sample-categories for details on the next 4 fields. -->
<!-- Most samples just need to udpate the Categories field. This is a comma-
seperated list of topic tags. Unlike the old category system, samples
may have multiple categories, so feel free to add extras. Try to avoid
simply tagging everything with "UI". :)-->
<categories>Notification, Wearable</categories>
<technologies>Android</technologies>
<languages>Java</languages>
<solutions>Mobile</solutions>
<!-- Values: {BEGINNER | INTERMEDIATE | ADVANCED | EXPERT} -->
<!-- Beginner is for "getting started" type content, or essential content.
(e.g. "Hello World", activities, intents)
Intermediate is for content that covers material a beginner doesn't need
to know, but that a skilled developer is expected to know.
(e.g. services, basic styles and theming, sync adapters)
Advanced is for highly technical content geared towards experienced developers.
(e.g. performance optimizations, custom views, bluetooth)
Expert is reserved for highly technical or specialized content, and should
be used sparingly. (e.g. VPN clients, SELinux, custom instrumentation runners) -->
<level>INTERMEDIATE</level>
<!-- Dimensions: 512x512, PNG fomrat -->
<icon>screenshots/icon-web.png</icon>
<!-- Path to screenshots. Use <img> tags for each. -->
<screenshots>
<img>screenshots/mobile-1.png</img>
<img>screenshots/mobile-2.png</img>
<img>screenshots/wear-1.png</img>
<img>screenshots/wear-2.png</img>
</screenshots>
<!-- List of APIs that this sample should be cross-referenced under. Use <android>
for fully-qualified Framework class names ("android:" namespace).
Use <ext> for custom namespaces, if needed. See "Samples Index API" documentation
for more details. -->
<api_refs>
<android>android.app.Notification</android>
<android>android.support.v4.app.NotificationCompat.BigPictureStyle</android>
<android>android.support.v4.app.NotificationCompat.BigTextStyle</android>
<android>android.support.v4.app.NotificationCompat.InboxStyle</android>
<android>android.support.v4.app.NotificationCompat.MessagingStyle</android>
<android>android.support.v4.app.NotificationManagerCompat</android>
<android>android.support.v4.app.RemoteInput</android>
<android>android.support.v4.app.TaskStackBuilder</android>
<android>android.support.v7.app.AppCompatActivity</android>
<android>android.support.v7.app.NotificationCompat</android>
</api_refs>
<!-- 1-3 line description of the sample here.
Avoid simply rearranging the sample's title. What does this sample actually
accomplish, and how does it do it? -->
<description>
Sample demonstrates best practices for using NotificationStyle Notifications (Inbox,
BigPicture, BigText, and Messaging) for both Mobile apps and native/local Wear
apps. It also covers Notifications on Wear 1.+ and Wear 2.0.
</description>
<!-- Multi-paragraph introduction to sample, from an educational point-of-view.
Makrdown formatting allowed. This will be used to generate a mini-article for the
sample on DAC. -->
<intro>
<![CDATA[
Steps for trying out the sample:
* Compile and install the mobile app onto your mobile device or emulator (for mobile
scenario).
* Compile and install the wearable app onto your Wear device or emulator (for Wear
scenario).
This sample demonstrate best practices for using [NotificationStyle][1]
[Notifications][2] for two scenarios:
1. Launching Notifications from a Mobile app WITHOUT a native Wear app.
Notifications appear both on mobile and Wear (bridged to appear like a local/native
Wear app).
2. Launching Notifications from a Native/Local Wear app. Notifications only
appear on Wear device.
The Mobile and Wear apps demonstrate [BigTextStyle][3], [BigPictureStyle][4],
[InboxStyle][5], and [MessagingStyle][6] Notifications.
Although there are two apps (Mobile and Wear) running, each should be looked at as a
separate experience. That is, neither app uses nor relies on the other.
They are packaged together simply to show both scenarios in one easy sample.
Both apps also cover the Notifications being displayed on Wear 1.+ and/or Wear 2.0 and
using some of the new features of Wear 2.0 (inline actions).
[1]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Style.html
[2]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.html
[3]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.BigTextStyle.html
[4]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.BigPictureStyle.html
[5]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.InboxStyle.html
[6]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.MessagingStyle.html
]]>
</intro>
</metadata>
</sample>