This is an small example to demonstrate the features of the Storage Access Framework.
Much of it is based on the nice guide on developer.android.com, which I recommend you read.
The Vault directory contains a non-trivial example DocumentsProvider by Jeff Sharkey that encrypts files, copied from the Android source code. I've added a build.gradle for easy consumption. Other examples include Storage Provider and Storage Client.
Another nice resource on SAF is episode 2 of Android Developers Backstage so give that a listen while you're at it too.