Json Data stored, cannot be found once application is launched

Hello,

I am having troubles with my windows phone application, built with Unity.

It works fine wth Unity, but, I have built it and doing tests with the project generated, with Visual Studio and my phone, i cannot load the Json file i use to store my data.

I tries to load a C:\Data\SharedData.… instead on using the correct path.
In my scripts, I load it in the Assets/Data folder. I cannot find anything in the generated code to see where the file is stored, and where to change the path if needed.

So many questions maybe. Should i use another way to load it ? Should i put it and load it from the root ? (in fact, i tried this one and i doesn’t works). I thought to use the “Application.persistentDataPath”, but i cannot set it before installing the app in the phone.

I think maybe someone already experienced this kind of issues.

Thank you !!

Is that JSON file created by the game? Or do you create before building the game and it will never change on the device?

Hi, the second solution, it is my “database”. I use it to store some questions, and i will not update it will playing.

Store it in Assets\StreamingAssets folder in your project, and then you’ll be able to access it through Application.streamingAssetsPath in the game.

1 Like

Thanks a lot, it work like a charm.