How do you create / open files using the Storage Access Framework (SAF)?

How do you create / open (non-media) files using the Storage Access Framework (SAF), especially on Android 10+?

Reason for asking:
Many apps need access to files in the external storage that were created by other apps. See here:

https://developer.android.com/training/data-storage/shared/documents-files

https://medium.com/swlh/sample-for-android-storage-access-framework-aka-scoped-storage-for-basic-use-cases-3ee4fee404fc

@Taifun already asked this as well.

The question is aimed in particular at the MIT team.

6 Likes