Skip to content

Most visited

Recently visited

navigation

範例

下列程式碼範例是針對 Android N 提供。如果要在 Android Studio 中下載, 範例,請選取 [File] > [Import Samples] 選單選項。

注意:這些可下載的專案是專為與 Gradle 和 Android Studio 一起使用而設計。

多視窗 Playground

此範例示範如何在您的應用程式中發揮多視窗使用者介面的功能。

在 GitHub 上取得

使用中通知

這是現有的範例,它會顯示使用 NotificationCompat 傳送通知的簡單服務。來自使用者的每個未閱讀交談都會以個別通知方式傳送。

已更新此範例以利用 Android N 中的新通知功能。

在 GitHub 上取得

簡訊服務

這是現有的範例,它示範如何使用 NotificationManager 告知使用者應用程式目前顯示的通知數目。

已更新此範例以利用 Android N 中的新通知功能。

在 GitHub 上取得

直接開機

此範例示範如何在裝置加密的儲存空間 (裝置開機後即一律可用) 中儲存及存取資料。

在 GitHub 上取得

限定範圍目錄存取

此範例示範如何讀取及寫入特定目錄的資料,同時要求較少的權限。

在 GitHub 上取得

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.