**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”被選中,每個新的文檔都將在概覽菜單中創建一個新的任務

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