assets 在包中是没有path的

来源:互联网 发布:h5游戏渠道数据分享 编辑:程序博客网 时间:2024/06/02 02:35


ZZZZZhttp://stackoverflow.com/questions/6678951/how-do-i-get-the-absolute-path-of-assets-directory-in-android

There is no "path of the assets directory" on the device.

I just want the path of the assets directory which I want to use as a variable throughout my app.

There is no "path of the assets directory" on the device.

I know we can refer a file in the "assets" directory using AssetManager, but I don't want to refer a file as of now, I just want the path of the assets directory.

There is no "path of the assets directory" on the device.

Can anybody help me with this?

No, because there is no "path of the assets directory" on the device. Please use AssetManager to retrieve an InputStream to your assets as needed.

Since android has a file size restriction on files inside raw directory, I will be placing my files in assets directory, and during runtime, I would be retrieving them as need

The "restriction" is the same for assets, AFAIK. The usual way to circumvent the "restriction" is to give the file an extension that Android's build tools will not try to compress (.mp3 works IIRC).

0 0
原创粉丝点击