简体   繁体   English

存储,以便其他应用程序可以访问我的媒体/非媒体文件

[英]Storage so my media/non media files are accessible by other apps

I am confused with the new app storage system in Android.我对 Android 中的新应用程序存储系统感到困惑。 I am not sure where my use case falls under and I need your help in telling me the right approach for this我不确定我的用例属于哪里,我需要你的帮助来告诉我正确的方法

My app captures images and generates pdf documents.我的应用程序捕获图像并生成 pdf 文档。 Prior to Android 10, I used to store them in an app directory where the user can easily navigate to them through other files browsing app (like Files app on Samsung).在 Android 10 之前,我曾经将它们存储在应用程序目录中,用户可以通过其他文件浏览应用程序(如三星上的文件应用程序)轻松导航到它们。 In addition, these files can be accessed from within my app (so essentially read and write).此外,可以从我的应用程序中访问这些文件(本质上是读写)。

With the new storage, I am not sure how to accomplish the same thing.使用新存储,我不确定如何完成同样的事情。 If I use the internal storage then user can't see them.如果我使用内部存储,那么用户将看不到它们。 If I use the media approach, well it seems it is only for Audio/video plus they will not be organized in a folder like I have them organized.如果我使用媒体方法,那么它似乎仅适用于音频/视频,而且它们不会像我组织的那样组织在一个文件夹中。

Am I missing something?我错过了什么吗? How would I solve this problem?我将如何解决这个问题?

Thank you谢谢

On an Android 11 device you can store your files in a subdirectory of the public Documents directory.在 Android 11 设备上,您可以将文件存储在公共 Documents 目录的子目录中。

You can do that using classic File means or the media store or SAF.您可以使用经典的文件方式或媒体存储或 SAF 来做到这一点。

Other apps can see them using SAF or the media store.其他应用程序可以使用 SAF 或媒体商店看到它们。 Or with classic file means when requested all files access.或使用经典文件意味着当请求所有文件访问时。

The user can see them using the default Files app on the device.用户可以使用设备上的默认文件应用程序查看它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM