Reputation: 6983
I am using android studio to build my app. I have a text file called testdata.txt. I would like this file to be loaded in with my app. Then have my app read the file. I figured out how to open and read files, but I dont know how to add the file to my project so it will be loaded when the app is loaded.
Upvotes: 0
Views: 25
Reputation: 230
Put the file in /res/raw
Then you can access it through:
getResources().openRawResource(R.raw.filename);
Upvotes: 2