| <?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>LNotifications Sample</name> |
| <group>Notification</group> |
| <package>com.example.android.lnotifications</package> |
| |
| <!-- change minSdk if needed--> |
| <minSdk>21</minSdk> |
| |
| <dependency>com.android.support:design:28.0.0</dependency> |
| |
| <strings> |
| <intro> |
| <![CDATA[ |
| This sample demonstrates how new features for notifications introduced in Android L |
| are used such as Heads-Up notifications, visibility, people, category and priority |
| metadata. (Priority metadata has been present since Jelly Bean, but actually unused). |
| ]]> |
| </intro> |
| </strings> |
| |
| <template src="base"/> |
| |
| <metadata> |
| <status>PUBLISHED</status> |
| <categories>Notification</categories> |
| <technologies>Android</technologies> |
| <languages>Java</languages> |
| <solutions>Mobile</solutions> |
| <level>INTERMEDIATE</level> |
| <icon>screenshots/icon-web.png</icon> |
| <screenshots> |
| <img>screenshots/1-headsup.png</img> |
| <img>screenshots/2-visibility.png</img> |
| <img>screenshots/3-others.png</img> |
| </screenshots> |
| <api_refs> |
| <android>android.app.Notification</android> |
| <android>android.app.Notification.Builder</android> |
| <android>android.app.NotificationManager</android> |
| </api_refs> |
| |
| <description> |
| <![CDATA[ |
| This sample demonstrates new features for notifications introduced in Android L. |
| These features include heads-up notifications, visibility, people, category and priority |
| metadata. |
| ]]> |
| </description> |
| |
| <intro> |
| <![CDATA[ |
| Android 5.0 (Lollipop, API level 21) introduced additional features to the Notification API. |
| Specifically, it allows developers to specify the priority and visibility level for |
| notifications. This metadata allows the system to provide enhanced security for notifications |
| while the lock screen is active, allows high-priority notifications to appear even when |
| the notification bar is closed, and provides users to silence low-priority notifications |
| when they're busy. |
| |
| This metadata is provided via additional arguments to the `Notification.Builder` class. |
| |
| Specifically, this sample demonstrates how to generate a heads-up notification |
| (`HeadsUpNotificationFragment`), how to control visibility on the lock screen |
| (`VisibilityMetadataFragment`), and how to set the category, priority, and associated contact |
| for a notification (`OtherMetadataFragment`). |
| ]]> |
| </intro> |
| </metadata> |
| </sample> |