Scoped Storage Stories: SAF Basics
Android 10 is greatly restricting access to external storage via filesystem APIs. Instead, we need to use other APIs to work with content. This is the first post in a series where we will explore how to work with those alternatives, starting with the Storage Access Framework (SAF). The Storage Access Framework operates on the same principles of file-selection UIs that users have been using for decades: We have a way to ask the user to choose an existing file or other piece of content ( ACTION_OPEN_DOCUMENT ) We have a way to ask the user to choose where we can place a new piece of content that our app will create ( ACTION_CREATE_DOCUMENT ) We have a way to ask the user to choose an existing directory or other form of "document tree" that we can use for working with multiple documents and sub-trees ( ACTION_OPEN_DOCUMENT_TREE ) The first two have been available since Android 4.4; ACTION_OPEN_DOCUMENT_TREE was added in Android 5.1. The vast majorit