Lecture 8: File Pickers and Media Pickers Flashcards
What are advantages to using file pickers?
- no special permissions
- uses a standardized interface across all apps
Rather than ask the user for permission to find a file, File pickers get the user to __ and use that as ___
- find the file for us
- implicit permission
Using file pickers, its up to the user to decide __
then the system handles permissions for ___
- what files the app gets access to specifically
- accessing those files directly
Due to the file picker being managed by the system and not the app the underlying app does not have ___
access to what the file picker can see
Selected files are added to a __ and stored in __
- DocumentProvider
- A table along with who requested them and can access them
Because the file picker interface is driven by existing DocumentProvider services on the Android device, it __
automatically integrates many other applications
A Document Picker is just a subclass of __
ContentProvider
File pickers can be set up to pull from __ or __ storage
- remote
- app-organized
When using a openFile() method to invoke a file picker UI what does it include?
A set of intents for the action that set certain parameters
A return code the activity will return when completed
What is the purpose of the return code?
Identifies which activity your running if your running multiple activities at once
What is the purpose of an intent?
Lets android know:
- How you want to open a file
- What type of file youre looking for
What are 2 base intents file pickers use
- ACTION_OPEN_DOCUMENT
- ACTION_OPEN_DOCUMENT_TYPE
What is the difference between ACTION_OPEN_DOCUMENT and ACTION_OPEN_DOCUMENT_TYPE?
ACTION_OPEN_DOCUMENT
Selects a specific file to open
ACTION_OPEN_DOCUMENT_TYPE
Give the app access to all files within a selected directory
What is a content URI?
A URI that identifies data in a provider
How do you resolve the content URI?
Use the ContentResolver with SQL parameters
or
getContentResolver().openInputStream(uri)