Android的:如何找到资产的文件夹的绝对路径? [英] Android: How to find the absolute path of the assets folder?
问题描述
我需要让我的应用程序资产的文件夹的绝对路径,我想提供内部使用的网络服务器中的文件,它需要绝对路径。这可能吗?
我会认为有可能是这样的:
字符串ROOTDIR = getAssets()getRootDirectory()。
但事实并非如此。
任何帮助AP preciated,欢呼声。
这可能吗?
没有。没有在[你]的应用程序资产的文件夹的绝对路径。资产被存储在APK文件
在选择的情况下,如提供给的WebView
,您可以用网址的特殊文件:/// android_asset
基本URL引用的文件在你的资产。
I need to get the absolute path of the assets folder in my app as I want to serve the files within using a webserver and it needs the absolute path. Is this possible?
I would have thought there might be something like this:
String rootDir = getAssets().getRootDirectory();
but there's not.
Any help appreciated, cheers.
Is this possible?
No. There is no "absolute path of the assets folder in [your] app". Assets are stored in the APK file.
In select cases, such as URLs supplied to a WebView
, you can use the special file:///android_asset
base URL to reference files in your assets.
这篇关于Android的:如何找到资产的文件夹的绝对路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!