开发者

Access and read a file inside Android project

开发者 https://www.devze.com 2023-03-23 23:57 出处:网络
I\'m working on an Android project with multipl开发者_StackOverflow社区e layers such as core,business,gui etc.

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

精彩评论

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

关注公众号