SlideShare a Scribd company logo
1 of 15
Download to read offline
WHY Uri?
STORAGE AND THE MODERN ANDROID APP
PROVIDERS IN 60 SECONDS
OR THEREABOUTS. PLEASE DON'T TIME ME.
ContentProvider subclass
Serve streams or database-style structures
Principally for data exchange with other apps
Uri to identify content (or a collection)
ContentResolver as foundation for consuming that
content
ANDROID AT 10+
November 2007
Android announced
Android SDK beta released
Open Handset Alliance announced ¯_(ツ)_/¯
Development started well before 2007
THE WEB: SEEMINGLY POPULAR
COMPUSERVE AIN'T WALKIN' THROUGH THAT DOOR
Much of the Android philosophy was an attempt to apply
Web concepts to local environments, sans HTML
Example: startActivity() ~= hyperlink to other Web
page or site
Storage approach influenced by standard HTTP and REST
REST, SANS RELAXATION
GET, PUT, DELETE for reading, writing, deleting a resource
Various conventions for creating a resource (e.g., POST)
Dynamic access control (authentication headers, session
cookies, etc.)
Server determines where content comes from (static,
generated, etc.)
FILES
ORGANIZING BYTES SINCE 1950!
OS and language means for reading, writing, deleting, and
creating files
Static access control (permission bits, ACLs, etc.)
Static content
STREAMING PROVIDERS
A RESTED DEVELOPMENT
openInputStream(), openOutputStream(),
delete() for reading, writing, and deleting content by
Uri
Various conventions for creating content
(ACTION_CREATE_DOCUMENT)
Dynamic access control (permissions, temporary content
access)
Provider determines where content comes from (static,
generated, etc.)
THE VISION
NO, NOT PAUL BETTANY'S CHARACTER IN THE AVENGERS
Files are for things that you own, mostly internal storage
Providers are for things that you share including sharing
with the platform
MediaStore for things the user sees as files
ACTION_GET_CONTENT,
ACTION_OPEN_DOCUMENT, etc. for app-managed
content
WHAT WENT WRONG?
THROWING GOOGLE UNDER THE BUS AND RUNNING OVER
THEM REPEATEDLY
Limited documentation
Poor examples in AOSP and Google proprietary apps
No real leadership on this topic (until some recently)
Result: emphasis on files for sharing
THE TIMES, THEY ARE A-CHANGIN'
Android 4.4: No arbitrary filesystem access to removable
storage
Android 6.0: Runtime permissions for external storage
Android 7.0: FileUriExposedException
Android O: So limits on cached data
PLAYING NICE WITH ANDROID
CONSUMING CONTENT
Get a Uri
Proactively: ACTION_GET_CONTENT,
ACTION_OPEN_DOCUMENT, MediaStore, etc.
Reactively: content scheme in <data>, drag-and-
drop, clipboard, etc.
Use ContentResolver to work with it
Use OpenableColumns for display name and size
PLAYING NICE WITH ANDROID
BENEFITS OF ACTION_OPEN_DOCUMENT
Works with external storage, removable storage, Google
Drive, etc.
DocumentFile or DocumentFileCompat for
accessing metadata
takePersistableUriPermissions() for durable
access to the content
PLAYING NICE WITH ANDROID
SHARING CONTENT
FileProvider
StreamProvider from CWAC-Provider
Your own ContentProvider or
DocumentsProvider
Supply Uri to other apps, using
FLAG_GRANT_READ_URI_PERMISSION
BUT I NEED A FILE
Use a file picker library, not ACTION_GET_CONTENT
Create a Local Copy of the Content
Temporary (copy to cache, use, delete)
Not so temporary ("import")
QUESTIONS?

More Related Content

Similar to Why uri storage and the modern android app

Synapseindia drupal intro 0
Synapseindia drupal intro 0Synapseindia drupal intro 0
Synapseindia drupal intro 0saritasingh19866
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android StudioSuyash Srijan
 
Open Content Library @ Taiwan
Open Content Library @ TaiwanOpen Content Library @ Taiwan
Open Content Library @ TaiwanJon Phillips
 
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...cresco
 
Open Source examples from Adobe : Oscon kiosk
Open Source examples from Adobe : Oscon kioskOpen Source examples from Adobe : Oscon kiosk
Open Source examples from Adobe : Oscon kioskDave McAllister
 
Presentation - Android App Development - Mr. Samrakchan
Presentation - Android App Development - Mr. SamrakchanPresentation - Android App Development - Mr. Samrakchan
Presentation - Android App Development - Mr. SamrakchanMobileNepal
 
Web Archiving Intro (circa 2015)
Web Archiving Intro (circa 2015)Web Archiving Intro (circa 2015)
Web Archiving Intro (circa 2015)Anna Perricci
 
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 TechnologiesAnvith K.S.
 
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 TechnologiesAnvith K.S.
 
UCD Android Workshop
UCD Android WorkshopUCD Android Workshop
UCD Android WorkshopSean Murphy
 
Copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-10-12
Copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-10-12Copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-10-12
Copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-10-12alysonkaye
 
Final copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-...
Final copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-...Final copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-...
Final copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-...alysonkaye
 
Build, host and manage your custom API in less than an hour
Build, host and manage your custom API in less than an hourBuild, host and manage your custom API in less than an hour
Build, host and manage your custom API in less than an hourJerome Louvel
 
Mobile Application Development -Lecture 11 & 12.pdf
Mobile Application Development -Lecture 11 & 12.pdfMobile Application Development -Lecture 11 & 12.pdf
Mobile Application Development -Lecture 11 & 12.pdfAbdullahMunir32
 
Introduction To Open Web Protocols
Introduction To Open Web ProtocolsIntroduction To Open Web Protocols
Introduction To Open Web ProtocolsMohan Krishnan
 
Open Content Library LGM 2007
Open Content Library LGM 2007Open Content Library LGM 2007
Open Content Library LGM 2007Jon Phillips
 
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...sbclapp
 

Similar to Why uri storage and the modern android app (20)

Synapseindia drupal intro 0
Synapseindia drupal intro 0Synapseindia drupal intro 0
Synapseindia drupal intro 0
 
Starting Up a Cost-Free Library Portal for Small-funded Libraries
Starting Up a Cost-Free Library Portal for Small-funded LibrariesStarting Up a Cost-Free Library Portal for Small-funded Libraries
Starting Up a Cost-Free Library Portal for Small-funded Libraries
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
 
Open Content Library @ Taiwan
Open Content Library @ TaiwanOpen Content Library @ Taiwan
Open Content Library @ Taiwan
 
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
 
Open Source examples from Adobe : Oscon kiosk
Open Source examples from Adobe : Oscon kioskOpen Source examples from Adobe : Oscon kiosk
Open Source examples from Adobe : Oscon kiosk
 
Presentation - Android App Development - Mr. Samrakchan
Presentation - Android App Development - Mr. SamrakchanPresentation - Android App Development - Mr. Samrakchan
Presentation - Android App Development - Mr. Samrakchan
 
Web Archiving Intro (circa 2015)
Web Archiving Intro (circa 2015)Web Archiving Intro (circa 2015)
Web Archiving Intro (circa 2015)
 
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies
 
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies
3iGlobal Pvt. Ltd. - Presentation on Web 2.0 Technologies
 
UCD Android Workshop
UCD Android WorkshopUCD Android Workshop
UCD Android Workshop
 
Copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-10-12
Copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-10-12Copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-10-12
Copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-10-12
 
Project_Proposal
Project_ProposalProject_Proposal
Project_Proposal
 
Final copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-...
Final copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-...Final copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-...
Final copyofopensourcesites softwareandpresentationoutlineforslideshowfinal5-...
 
Assignment imd113 cloud storage
Assignment imd113 cloud storageAssignment imd113 cloud storage
Assignment imd113 cloud storage
 
Build, host and manage your custom API in less than an hour
Build, host and manage your custom API in less than an hourBuild, host and manage your custom API in less than an hour
Build, host and manage your custom API in less than an hour
 
Mobile Application Development -Lecture 11 & 12.pdf
Mobile Application Development -Lecture 11 & 12.pdfMobile Application Development -Lecture 11 & 12.pdf
Mobile Application Development -Lecture 11 & 12.pdf
 
Introduction To Open Web Protocols
Introduction To Open Web ProtocolsIntroduction To Open Web Protocols
Introduction To Open Web Protocols
 
Open Content Library LGM 2007
Open Content Library LGM 2007Open Content Library LGM 2007
Open Content Library LGM 2007
 
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
 

More from DevFest DC

Push Notifications Or: How I Learned to Stop Worrying and Love NotificationCo...
Push Notifications Or: How I Learned to Stop Worrying and Love NotificationCo...Push Notifications Or: How I Learned to Stop Worrying and Love NotificationCo...
Push Notifications Or: How I Learned to Stop Worrying and Love NotificationCo...DevFest DC
 
Reactive Programming in Akka
Reactive Programming in AkkaReactive Programming in Akka
Reactive Programming in AkkaDevFest DC
 
Containers, microservices and azure
Containers, microservices and azureContainers, microservices and azure
Containers, microservices and azureDevFest DC
 
Programming Google apps with the G Suite APIs
Programming Google apps with the G Suite APIsProgramming Google apps with the G Suite APIs
Programming Google apps with the G Suite APIsDevFest DC
 
Snowflakes in the Cloud Real world experience on a new approach for Big Data
Snowflakes in the Cloud Real world experience on a new approach for Big DataSnowflakes in the Cloud Real world experience on a new approach for Big Data
Snowflakes in the Cloud Real world experience on a new approach for Big DataDevFest DC
 
Well, That Escalated Quickly: Anomaly Detection with Elastic Machine Learning
Well, That Escalated Quickly: Anomaly Detection with Elastic Machine LearningWell, That Escalated Quickly: Anomaly Detection with Elastic Machine Learning
Well, That Escalated Quickly: Anomaly Detection with Elastic Machine LearningDevFest DC
 
Myths of Angular 2: What Angular Really Is
Myths of Angular 2: What Angular Really IsMyths of Angular 2: What Angular Really Is
Myths of Angular 2: What Angular Really IsDevFest DC
 
Android Things Robocar with TensorFlow for object recognition
Android Things Robocar with TensorFlow for object recognitionAndroid Things Robocar with TensorFlow for object recognition
Android Things Robocar with TensorFlow for object recognitionDevFest DC
 
Troubleshooting & debugging production microservices in Kubernetes with Googl...
Troubleshooting & debugging production microservices in Kubernetes with Googl...Troubleshooting & debugging production microservices in Kubernetes with Googl...
Troubleshooting & debugging production microservices in Kubernetes with Googl...DevFest DC
 
Hack the Real World with ANDROID THINGS
Hack the Real World with ANDROID THINGSHack the Real World with ANDROID THINGS
Hack the Real World with ANDROID THINGSDevFest DC
 
Using Cloud Vision To Watch The World’s News Imagery In Realtime: The GDELT P...
Using Cloud Vision To Watch The World’s News Imagery In Realtime: The GDELT P...Using Cloud Vision To Watch The World’s News Imagery In Realtime: The GDELT P...
Using Cloud Vision To Watch The World’s News Imagery In Realtime: The GDELT P...DevFest DC
 
Teaching machines to see the process of designing (datasets) with ai
Teaching machines to see  the process of designing (datasets) with aiTeaching machines to see  the process of designing (datasets) with ai
Teaching machines to see the process of designing (datasets) with aiDevFest DC
 

More from DevFest DC (12)

Push Notifications Or: How I Learned to Stop Worrying and Love NotificationCo...
Push Notifications Or: How I Learned to Stop Worrying and Love NotificationCo...Push Notifications Or: How I Learned to Stop Worrying and Love NotificationCo...
Push Notifications Or: How I Learned to Stop Worrying and Love NotificationCo...
 
Reactive Programming in Akka
Reactive Programming in AkkaReactive Programming in Akka
Reactive Programming in Akka
 
Containers, microservices and azure
Containers, microservices and azureContainers, microservices and azure
Containers, microservices and azure
 
Programming Google apps with the G Suite APIs
Programming Google apps with the G Suite APIsProgramming Google apps with the G Suite APIs
Programming Google apps with the G Suite APIs
 
Snowflakes in the Cloud Real world experience on a new approach for Big Data
Snowflakes in the Cloud Real world experience on a new approach for Big DataSnowflakes in the Cloud Real world experience on a new approach for Big Data
Snowflakes in the Cloud Real world experience on a new approach for Big Data
 
Well, That Escalated Quickly: Anomaly Detection with Elastic Machine Learning
Well, That Escalated Quickly: Anomaly Detection with Elastic Machine LearningWell, That Escalated Quickly: Anomaly Detection with Elastic Machine Learning
Well, That Escalated Quickly: Anomaly Detection with Elastic Machine Learning
 
Myths of Angular 2: What Angular Really Is
Myths of Angular 2: What Angular Really IsMyths of Angular 2: What Angular Really Is
Myths of Angular 2: What Angular Really Is
 
Android Things Robocar with TensorFlow for object recognition
Android Things Robocar with TensorFlow for object recognitionAndroid Things Robocar with TensorFlow for object recognition
Android Things Robocar with TensorFlow for object recognition
 
Troubleshooting & debugging production microservices in Kubernetes with Googl...
Troubleshooting & debugging production microservices in Kubernetes with Googl...Troubleshooting & debugging production microservices in Kubernetes with Googl...
Troubleshooting & debugging production microservices in Kubernetes with Googl...
 
Hack the Real World with ANDROID THINGS
Hack the Real World with ANDROID THINGSHack the Real World with ANDROID THINGS
Hack the Real World with ANDROID THINGS
 
Using Cloud Vision To Watch The World’s News Imagery In Realtime: The GDELT P...
Using Cloud Vision To Watch The World’s News Imagery In Realtime: The GDELT P...Using Cloud Vision To Watch The World’s News Imagery In Realtime: The GDELT P...
Using Cloud Vision To Watch The World’s News Imagery In Realtime: The GDELT P...
 
Teaching machines to see the process of designing (datasets) with ai
Teaching machines to see  the process of designing (datasets) with aiTeaching machines to see  the process of designing (datasets) with ai
Teaching machines to see the process of designing (datasets) with ai
 

Recently uploaded

Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesChandrakantDivate1
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfCWS Technology
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsChandrakantDivate1
 
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...Pooja Nehwal
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Servicenishacall1
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsChandrakantDivate1
 

Recently uploaded (8)

Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 

Why uri storage and the modern android app

  • 1. WHY Uri? STORAGE AND THE MODERN ANDROID APP
  • 2. PROVIDERS IN 60 SECONDS OR THEREABOUTS. PLEASE DON'T TIME ME. ContentProvider subclass Serve streams or database-style structures Principally for data exchange with other apps Uri to identify content (or a collection) ContentResolver as foundation for consuming that content
  • 3. ANDROID AT 10+ November 2007 Android announced Android SDK beta released Open Handset Alliance announced ¯_(ツ)_/¯ Development started well before 2007
  • 4. THE WEB: SEEMINGLY POPULAR COMPUSERVE AIN'T WALKIN' THROUGH THAT DOOR Much of the Android philosophy was an attempt to apply Web concepts to local environments, sans HTML Example: startActivity() ~= hyperlink to other Web page or site Storage approach influenced by standard HTTP and REST
  • 5. REST, SANS RELAXATION GET, PUT, DELETE for reading, writing, deleting a resource Various conventions for creating a resource (e.g., POST) Dynamic access control (authentication headers, session cookies, etc.) Server determines where content comes from (static, generated, etc.)
  • 6. FILES ORGANIZING BYTES SINCE 1950! OS and language means for reading, writing, deleting, and creating files Static access control (permission bits, ACLs, etc.) Static content
  • 7. STREAMING PROVIDERS A RESTED DEVELOPMENT openInputStream(), openOutputStream(), delete() for reading, writing, and deleting content by Uri Various conventions for creating content (ACTION_CREATE_DOCUMENT) Dynamic access control (permissions, temporary content access) Provider determines where content comes from (static, generated, etc.)
  • 8. THE VISION NO, NOT PAUL BETTANY'S CHARACTER IN THE AVENGERS Files are for things that you own, mostly internal storage Providers are for things that you share including sharing with the platform MediaStore for things the user sees as files ACTION_GET_CONTENT, ACTION_OPEN_DOCUMENT, etc. for app-managed content
  • 9. WHAT WENT WRONG? THROWING GOOGLE UNDER THE BUS AND RUNNING OVER THEM REPEATEDLY Limited documentation Poor examples in AOSP and Google proprietary apps No real leadership on this topic (until some recently) Result: emphasis on files for sharing
  • 10. THE TIMES, THEY ARE A-CHANGIN' Android 4.4: No arbitrary filesystem access to removable storage Android 6.0: Runtime permissions for external storage Android 7.0: FileUriExposedException Android O: So limits on cached data
  • 11. PLAYING NICE WITH ANDROID CONSUMING CONTENT Get a Uri Proactively: ACTION_GET_CONTENT, ACTION_OPEN_DOCUMENT, MediaStore, etc. Reactively: content scheme in <data>, drag-and- drop, clipboard, etc. Use ContentResolver to work with it Use OpenableColumns for display name and size
  • 12. PLAYING NICE WITH ANDROID BENEFITS OF ACTION_OPEN_DOCUMENT Works with external storage, removable storage, Google Drive, etc. DocumentFile or DocumentFileCompat for accessing metadata takePersistableUriPermissions() for durable access to the content
  • 13. PLAYING NICE WITH ANDROID SHARING CONTENT FileProvider StreamProvider from CWAC-Provider Your own ContentProvider or DocumentsProvider Supply Uri to other apps, using FLAG_GRANT_READ_URI_PERMISSION
  • 14. BUT I NEED A FILE Use a file picker library, not ACTION_GET_CONTENT Create a Local Copy of the Content Temporary (copy to cache, use, delete) Not so temporary ("import")