-1

I have a quiz app working on windows. This quiz works by loading the questions and answers of a bunch of .json files that are located in a folder called "/db/" and this folder is in the same folder as the .exe itself. The problem is that on windows it is easy to put this .json in the same folder as the .exe, but on when compiling for Android the result is a single .apk file.

Yes, I do know about Application.persistentDataPath but the problem is that the data is first external and then loaded on the app.

Is there any way to add this folder "/db" to the .apk and to have this folder in the same as the app itself on Android?

1 Answers1

1

Put your "/db/" folder into Assets folder. Than you can get it's path on Android by:

string path = "jar:file://" + Application.dataPath + "!/assets/db/";

Sidenote: You have to use WWW class to retrieve file because it's compressed by default. Read this.