开发者

Access and read a file inside Android project

I'm working on an Android project with multipl开发者_StackOverflow社区e layers such as core,business,gui etc.

I wanna read an Application.properties file in core layer for example but when I use standart java file reading methods I access phone directories.

How can I load such a properties file that resides under com.xxx.properties package in my core layer?

Thank you.


You can for example have access to a file you previsously placed in the assets folder.

InputStream myInput = myContext.getAssets().open(name_of_file);

and you can use:

myInput.read();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜