Android的内部存储器路径

问题描述:

我在我的Andr​​oid平板电脑的内部存储器的文件,我需要的路径文件的应用程序,但我不知道如何获得该文件的具体路径。

I have a file in the internal memory of my Android tablet and I need the path to that file for an application, but I do not know how to get the exact path of the file.

您不能简单的,如果它位于你的应用程序的专用存储传递文件的路径。问题是,其他的应用程序没有权限读取的应用程序,从而尝试将失败。

You cannot simply pass the file path if it is located in your app's private storage. The problem is, the other application does not have permissions to read the app, and thus would fail while trying.

您必须实现一个 的ContentProvider ,或者更特异性地,一个的 FileProvider

You'll have to implement a ContentProvider, or more specificly, a FileProvider.