android icon indicating copy to clipboard operation
android copied to clipboard

[FEATURE REQUEST] Register as cloud media provider

Open mjforan opened this issue 1 year ago • 8 comments

(Related to the new scoped storage model on Android)

Apps which have a photo picker use something called a cloud media provider. I would like to be able to select photos from OwnCloud but it does not appear - only Google Photos and "None" are possible sources.

Currently I have to use another file explorer app to "save as" my OwnCloud files into the Downloads folder. That way they are exposed to the photo picker.

mjforan avatar Jul 14 '24 23:07 mjforan

Hi @mjforan! Thanks for opening a new issue! 🍻

AFAIK, that photo picker you're talking about is the DocumentsProvider in Android, and works for every app that has its own implementation, as it happens with the ownCloud Android app. For example, if you go to Gmail, compose a new email and try to attach files, the DocumentsProvider will be opened and you will be able to select files from your ownCloud account (as long as you have disabled inside the ownCloud app Settings > Security > Lock access from document provider, which is disabled by default). If this is not the case, please describe your use case so that I can reproduce it.

OTOH, copying ownCloud files to the Downloads folder is a different use case, and here we do get in conflict with the scoped storage aim. But if your objective is just being able to pick photos from your ownCloud account, this shouldn't be needed, so as I said before, please describe your use case so that we can provide the best support 😀. Will wait for your response!

JuancaG05 avatar Jul 15 '24 06:07 JuancaG05

I am talking about something different. Yes I can access OwnCloud from gmail-> attach file, but there is a different option called "insert photo" which pulls from the registered cloud media providers. See my screenshots for what this looks like (Pixel 5, Android 14, OwnCloud 4.3.0). Some of my other apps use ONLY this media picker interface, especially if they are looking for pictures, not documents.

0_attachment_options 1_media_picker 2_media_picker_menu 3_no_owncloud

mjforan avatar Jul 15 '24 12:07 mjforan

Actually this API is currently restricted:

Only apps nominated by OEMs are eligible to participate in this program to become a cloud media provider for Android at this time.

https://developer.android.com/guide/topics/providers/cloud-media-provider

I guess I will have to encourage my other apps to implement the document provider browser.

mjforan avatar Jul 15 '24 12:07 mjforan

Hi @mjforan! Yeah, I see... I didn't know about cloud media providers, but I see it is kind of restrictive to access the program and being elegible. In any case, thanks for the issue, we can keep it open just in case in a future we're interested on fulfilling all the conditions and introduce it in the app 👍

For the moment you can pick your photos in your ownCloud account via the documents provider, if you're able to access the Downloads folder from any other app you should be able to access your ownCloud files via this provider.

JuancaG05 avatar Jul 15 '24 12:07 JuancaG05

Wouldn't this feature than be available for open source custom roms instead? Or perhaps I misunderstand the documentation.

Doomsdayrs avatar Sep 13 '24 14:09 Doomsdayrs

Hi @Doomsdayrs! I don't think so, as far as I understand, the cloud media provider registers elegible apps (not ownCloud currently) to choose pictures directly from the cloud of those apps. But nothing to do with custom roms.

JuancaG05 avatar Sep 16 '24 06:09 JuancaG05

I have found the owncloud only shows up sporadically among other document providers. For example, choosing to upload something as a fastmail (a main provider with their own app) attachment shows Google drive and yottacloud. Doing the same thing from outlook makes owncloud available.

I have the app linked in the app installed. It has made no difference.

I don't know if it is a fastmail issue, but it was just the first example I found. I know it has happened to me many times in many apps. Given that I can't "download" a file from the owncloud app to a folder on the device makes sharing files from owncloud through some apps a real hassle.

I use OwnCloud both personally and through a larger organisation and the problem manifests in both environments.

bjoli avatar Feb 17 '25 08:02 bjoli

Hi @bjoli!

Your problem seems not to be related with cloud media provider, which is what is asked in this issue. Your request could be something more related to https://github.com/owncloud/android/issues/4390. In any case, a workaround for your need of downloading files from the ownCloud app to another folder is an app that implements the DocumentsProvider (for example, Files). With this, you can copy any of your files in ownCloud to another folder in your device, by accessing them securely.

If you want to keep track of the DocumentsProvider problem, stay tuned to the other issue! 😀

JuancaG05 avatar Feb 18 '25 07:02 JuancaG05