From 546f0af6bed46c59bed3fb84b678e6ae1c117bdc Mon Sep 17 00:00:00 2001
From: Katie McCormick Android 4.4 (API level 19) introduces the Storage Access Framework. The
-Storage Access Framework encapsulates capabilities in the Android platform that
-allow apps to request files from file storage services. The Storage Access
-Framework includes the following: Android 4.4 (API level 19) introduces the Storage Access Framework (SAF). The SAF
+ makes it simple for users to browse and open documents, images, and other files
+across all of their their preferred document storage providers. A standard, easy-to-use UI
+lets users browse files and access recents in a consistent way across apps and providers. Cloud or local storage services can participate in this ecosystem by implementing a new
+{@link android.provider.DocumentsProvider} that encapsulates their services. Client
+apps that need access to a provider's documents can integrate with the SAF with just a few
+lines of code. The SAF includes the following: Some of the features offered by the Storage Access Framework are as follows: Some of the features offered by the SAF are as follows: The Storage Access Framework centers around a content provider that is a
+ The SAF centers around a content provider that is a
subclass of the {@link android.provider.DocumentsProvider} class. Within a document provider, data is
structured as a traditional file hierarchy:In this document
-
+
In this document
+
+ show more
+
+
+
-
Overview
-
Figure 2 shows an example of how a photo app might use the Storage Access Framework +
Figure 2 shows an example of how a photo app might use the SAF to access stored data:
@@ -143,7 +173,7 @@ to access stored data:Note the following:
You can use the Storage Access Framework to edit a text document in place. +
You can use the SAF to edit a text document in place. This snippet fires the {@link android.content.Intent#ACTION_OPEN_DOCUMENT} intent and uses the category {@link android.content.Intent#CATEGORY_OPENABLE} to to display only @@ -513,8 +543,8 @@ freshest data.
If you're developing an app that provides storage services for files (such as -a cloud save service), you can make your files available through the Storage -Access Framework by writing a custom document provider. This section describes +a cloud save service), you can make your files available through the +SAF by writing a custom document provider. This section describes how to do this.
@@ -540,13 +570,25 @@ For example:com.example.android.storageprovider.MyCloudProvider
.
You must export your provider so that other apps can see it.
android:grantUriPermissions
set to
-"true"
. This allows the system to grant other apps access
+"true"
. This setting allows the system to grant other apps access
to content in your provider. For a discussion of how to persist a grant for
a particular document, see Persist permissions.<bool name="atLeastKitKat">false</bool>
<bool name="atLeastKitKat">true</bool>
The {@link android.content.Intent#ACTION_OPEN_DOCUMENT} intent is only available @@ -583,7 +626,7 @@ on devices running Android 4.4 and higher. If you want your application to support {@link android.content.Intent#ACTION_GET_CONTENT} to accommodate devices that are running Android 4.3 and lower, you should disable the {@link android.content.Intent#ACTION_GET_CONTENT} intent filter in -your manifest if a device is running Android 4.4 or higher. A +your manifest for devices running Android 4.4 or higher. A document provider and {@link android.content.Intent#ACTION_GET_CONTENT} should be considered mutually exclusive. If you support both of them simultaneously, your app will appear twice in the system picker UI, offering two different ways of accessing @@ -630,7 +673,7 @@ implementing contract classes, as described in the Content Providers developers guide. A contract class is a {@code public final} class that contains constant definitions for the URIs, column names, MIME types, and -other metadata that pertain to the provider. The Storage Access Framework +other metadata that pertain to the provider. The SAF provides these contract classes for you, so you don't need to write your own:
@@ -872,4 +915,4 @@ available if the user is logged into the provider. getContentResolver().notifyChange(DocumentsContract .buildRootsUri(AUTHORITY), null); } - + \ No newline at end of file -- cgit v1.1