I have a local .json file. I don’t want it to be on a server, I just want it to be included in my app. I tried to paste it directly into Eclipse in my project, but I got a FileNotFoundException, I also tried to paste it in the workspace folder in Windows Explorer/Finder and got the same exception. Where should I put it?
Thanks!
You should put the file either in the
/assetsor/res/rawdirectory of your Android project. From there, you can retrieve it with either:Context.getResources().openRawResource(R.raw.filename)orContext.getResources().getAssets().open("filename").