Last minute crysis with orxConfig_Save on Android

edited August 2015 in Help request
I'm just about to release my game on the Android but have just discovered that the highscore will not save on a device. Windows works fine. The code is:
orxConfig_Save("save.ini", orxTRUE, SaveHighScoreToConfigFileCallback);

Android log gives me:
08-14 22:40:03.120 D/orxDebug(2385): [22:40:03] [SYSTEM] [orxResource.c:orxResource_Open():1968] Can't open resource <file:save.ini> of type <file>: unable to open the location.
08-14 22:40:03.120 D/orxDebug(2385): [22:40:03] [CONFIG] [orxConfig.c:orxConfig_Save():3725] [save.ini]: Can't save file, can't open file on disk!

This is compiled again orx rev 4327. My original pinball game is saving highscore ok with the same code, but with a build from 6 months ago.

The only permissions for the APK are to keep the device awake, same as my previous game.

I am about to start rolling back through orx commit builds from weeks ago in order to pinpoint where it stopped being able to save. Any ideas before I go through all that? Like I said, all fine on a Windows machine, but no go for Android.

Comments

  • edited August 2015
    use this
    const orxSTRING zSaveFile = orxFile_GetApplicationSaveDirectory("save.ini");
      orxConfig_Save(zSaveFile, orxFALSE, SaveCallback);
    
  • edited August 2015
    Thanks, lydesik. Plugging in now.
  • edited August 2015
    also make sure you load save.ini with orxConfig_Load() in your Init() function

    not via an include in a .ini file
    const orxSTRING zSaveFile = orxFile_GetApplicationSaveDirectory("save.ini");
      orxConfig_Load(zSaveFile);
    
  • edited August 2015
    lydesik, your blood is worth bottling! All in and working beautifully. Thanks so much.

    lydesik wrote:
    also make sure you load save.ini with orxConfig_Load() in your Init() function

    not via an include in a .ini file
    const orxSTRING zSaveFile = orxFile_GetApplicationSaveDirectory("save.ini");
      orxConfig_Load(zSaveFile);
    

    Oh yep, I'd already applied the same to the load routine as well.
Sign In or Register to comment.