开发者

Where to keep text files in Android project in eclipse

开发者 https://www.devze.com 2023-03-25 01:09 出处:网络
I am trying to find out, where should I keep text files in my Android project and how to refer their location in the code.

I am trying to find out, where should I keep text files in my Android project and how to refer their location in the code.

I kept my files under the main project directory and referred in the file as /sample.txt. but this did not work开发者_StackOverflow社区.


I would store it in the assets folder and reference it by using something like

Activity.getAssets().open(sample.txt)


You should keep them in /assets dir. Access them later with AssetManager.

0

精彩评论

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