owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.8k stars 3.05k forks source link

[FEATURE REQUEST] Register as cloud media provider #4436

Open mjforan opened 1 month ago

mjforan commented 1 month ago

(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.

JuancaG05 commented 1 month ago

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!

mjforan commented 1 month ago

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 commented 1 month ago

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.

JuancaG05 commented 1 month ago

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.