开发者

How do I get the absolute path of "assets" directory in Android?

I just want the path of the assets directory which I want to use as a varia开发者_运维问答ble throughout my app.

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.

Can anybody help me with this?


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).


Try using

AssetFileDescriptor

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜