I am currently testing the Android SFTP Documents Provider (https://github.com/RikyIsola/Android-SFTP-Documents-Provider). It works fine with the system's Files application (Android 8.1). In particular this file manager show lots of entries in its three-horizontal-bar menu: Downloads, internal, SD, Drive, SFTP and Termux.
In my own application I am using the standard SAF method to open a tree:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
...
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, uri);
}
intent.addFlags(
Intent.FLAG_GRANT_READ_URI_PERMISSION +
Intent.FLAG_GRANT_WRITE_URI_PERMISSION +
Intent.FLAG_GRANT_PREFIX_URI_PERMISSION +
Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
intent.putExtra("android.content.extra.SHOW_ADVANCED", true);
startActivityForResult(intent, REQUEST_DIRECTORY_SELECT);
}
Note that the strange "SHOW_ADVANCED" stuff is necessary to see the SD card, for whatever extremely strange reason. However, when the file picker opens, I see only Downloads, Internal and SD. Nothing more.
Worth to mention: The Android Samba Client works fine with my app, i.e. it indeed is visible in the File Picker. But SFTP is not.
Also to mention: The primitive ftpd (also available in F-Droid) also does not show the SFTP DocumentsProvider.
Do I need some manifest-filter-intent-whatever magic? Or is there a fundamental difference between the Samba DocumentsProvider and all others? Is it kind of more powerful?