I have an Android app that generates photos based on a math formula. I'd like to share these photos ideally with the ShareActionProvider.
Constraints: - Do not create files in the file system. - Do not require any permissions. (My app requires zero permissions, and I'd like to keep it that way.)
The Android documentation suggests to create a ContentProvider for serving the files. ContentProviders return cursors of columns and rows. How do I convert a file into a Cursor?
The Android documentation says that temporary per-URI permissions have to be generated for the other app. How can I have the ShareActionProvider tell me what permissions to generate? (There is no security concern to sharing these math images with everyone. How can I give access to everyone to my provider?)
PS: I've read dozens of posts related to this topic. Most create files or use the FileProvider (which I don't know how to use without actual files).
Update: This is the closest solution that I found. Yet, it still requires creating temp files, which I'd like to avoid: Android Share Intent for a Bitmap - is it possible not to save it prior sharing?