Ah thank you for the reply.
I’ve managed to change my ifstream stuff to this:
@ // Load the JSON document
const char* fullpath = NULL;
unsigned long filesize;
unsigned char* data;
fullpath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(lvl.getCollisionFile());
data = CCFileUtils::sharedFileUtils()->getFileData(fullpath, “r”, &filesize);
Which gets my json data and places it in a string
However, I have this wierd bug. If I leave the code like it is above, it still works on windows but won’t work on Android. It won’t find the assets even though they are in the correct place in the directory i think (in proj.android->assets).
When I replace the
fullpath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("levels/env1/level10/env1Lvl10Col.json");
My program still crashes. Is there something I’m not including or setting up correctly with eclipse? Is there something I need to edit to include the assets with my apk?