**What's New API 21新增加了什么**

What’s New API 21新增加了什么
The following code samples were recently published. You can download them in the Android SDK Manager under the SDK Samples component for API 21.
以下的示例程序是最近发布的。你可以在Android SDK manager 中下载API 21的SDK Samples
Note: The downloadable projects are designed for use with Gradle and Android Studio.
可下载的工程是专为Android studio 和 Gradle 设计的。

Media Browser Service 媒体浏览器服务
This sample is a simple audio media app that exposes its media library and provides metadata and playback controls through the new MediaBrowserService and MediaSession APIs from API 21. The sample is compatible with Android Auto and also provides a basic UI when not connected to a car.
这个示例程序是一个简单的暴露媒体库和提供元数据并且可以通过新增加的MediaBrowserService 控制重复播放的音频媒体APP。这个示例程序和Android Auto兼容并且也提供一个基础的UI界面。

Note: This sample is compatible with Android Auto.

Messaging Service 信息服务
This sample shows a simple service that sends notifications using NotificationCompat. In addition to sending a notification, it also extends the notification with a CarExtender to make it compatible with Android Auto. Each unread conversation from a user is sent as a distinct notification.
这个示例程序展示了一个简单的使用NotificationCompat发送通知信息的服务。除了发送条通知,它也扩展到了和Android Auto兼容,可以给CarExtender 发送信息。每条未被阅读的会话都会被当做一个不同的信息发送

Note: This sample is compatible with Android Auto.

Speed Tracker (Wear) 速度跟踪器(穿戴设备)
This sample uses the FusedLocation APIs of Google Play Services on Android Wear devices that have a hardware GPS built in. In those cases, this sample provides a simple screen that shows the current speed of the wearable device. User can set a speed limit and if the speed approaches that limit, it changes the color to yellow and if it exceeds the limit, it turns red. User can also enable recording of coordinates and when it pairs back with the phone, this data is synced with the phone component of the app and user can see a track made of those coordinates on a map on the phone.
这个示例程序使用Google Play Services里的FusedLocation API调用有GPS硬件的安卓穿戴设备。在这种情况下,这个示例程序提供一个简单的屏幕显示现有的穿戴设备的运行速度。用户可以设置一个速度限制,当速度接近限制时,屏幕颜色改变为黄色,当速度超过限制时屏幕变为红色。当和手机配对是用户还可以启用座标记录,这个数据和手机是同步的,用户可以在手机地图上看到一个运动轨迹。

AppRestrictionSchema APP限制图表?
This sample shows how to use app restrictions. This application has one boolean restriction with a key “can_say_hello” that defines whether the only feature of this app (press the button to show “Hello” message) is enabled or disabled. Use AppRestrictionEnforcer sample to toggle the restriction.
这个示例程序展示了如何使用APP限制。这个程序有一个布尔约束键”can_say_hello”,这个键定义了这个APP的唯一特征(是否显示HELLO消息)启用还是禁用。使用AppRestrictionEnforcer 示例程序切换这个限制

AppRestrictionEnforcer APP限制实施
This sample demonstrates how to set restrictions to other apps as a profile owner. Use AppRestrictionSchema sample as a app with available restrictions.
这个示例程序展示了作为一个配置文件拥有者怎么设置对其他APP的限制。使用AppRestrictionSchema 作为一个拥有可获得的约束条件的APP。

DocumentCentricRelinquishIdentity 文档中央放弃标识?
This sample shows how to relinquish identity to activities above it in the task stack.
这个示例程序展示了如何放弃任务栈之上activity的身份标识。(好奇怪,以后看程序就知道咋回事了)

DocumentCentricApps
This sample shows the basic usage of the new “Document Centric Apps” API. It let’s you create new documents in the system overview menu and persists its state through reboots. If “Task per document” is checked a new task will be created for every new document in the overview menu.
这个程序展示了”Document Centric Apps” API的基本使用。它让你在系统概览菜单创建一个新的文档并且在重启时也保持其状态。如果“Task per document”被选中,每个新的文档都将在概览菜单中创建一个新的任务

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章