What’s up guys,
so I was trying to use JSON databse in my project for Android and I got stopped on a nasty problem:
To use the JSON database I need to load it. On the windows I load it like this:
json_database_items = JsonMapper.ToObject(File.ReadAllText(Application.dataPath + “/Resources/StreamingAssets/Items.json”));
Property that allows me to get straight to the application dirrectory is Application.dataPath.
It doesn’t work on Android though, as app is packed there to .apk and should be used as a .zip archive, so I’ve googled a little and found several advices:
1)Use property Application.streamingAssets
Well, I’ve put the StreamingAssets folder to Assets folder and tried this option. Didn’t work.
2)To use WWW class, for opening database inside of .apk
Didn’t work as well for unknown reason. I put the Items.json straight to assets folder, tried to read ias a string this:
new WWW(“file:java/mnt/asec/companyname.com/pkg.apk!/assets/Items.json”).text;
But it didn’t work for some unknown to me reason, though everything seems correct and java url should have took care about archived file.
I also tryied to use property to use property Application.streamingAssets along with WWW class, but for
some another unknown reasong string returned with that property begins with “jar:file///” and this tripple slash does not seem to be neither working or correct to jar url syntaxis.
Right now I am out of options and I would like to get some help, because it does seem like desperate case here .___.
If you do know that I am wrong someway either made a mistake in code, or there is a simple solution to that task(Doesn’t seem like that and I wouldn’t mind any solution, even the difficult one) please, let me know.
Thx in forward, pals
P.S. Is there any meaning in trying to use 7zip sdk? If yes, could you please guide me a little in that dirrection?