About Store Forum Documentation Contact



Post Reply 
Issues Saving Files On Android [SOLVED]
Author Message
Scarlet Thread Offline
Member

Post: #1
Issues Saving Files On Android [SOLVED]
Hi all,

So I'm aware that on Android you can only edit / save files to SystemPath(SP_DOCUMENTS) or the SD card, however, I just can't seem to get it to work. I use xml files to save game data and It works fine on the PC but doesn't save at all on Android.

I'm probably doing something wrong. Any help would be appreciated.

Code:
XmlData xml
xml.load(EncodeFileName(UID(etc, etc, etc.)));

//Whole bunch of other code to edit the xml file here

xml.save(S + SystemPath(SP_DOCUMENTS) + "/QuantumBall/SaveData.xml"; /* I've also tried doulbe slash // in the text and that didn't help */

This is the very last thing I have to fix on this mini project before all the code is complete.
(This post was last modified: 01-07-2014 07:57 AM by Scarlet Thread.)
01-07-2014 12:52 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Issues Saving Files On Android
Did you create the "/QuantumBall" folder first?

On Android/iOS SP_DOCUMENTS already points to your app folder, so no need for extra folder in the path.

Oh and I think SP_APP_DATA is generally better than SP_DOCUMENTS (on iOS and Android they're actually the same, but other platforms return different values, I've updated Mobile docs for that)
01-07-2014 03:07 AM
Find all posts by this user Quote this message in a reply
Scarlet Thread Offline
Member

Post: #3
RE: Issues Saving Files On Android
Cheers Greg, that was my problem. It works now. Also changed it to SP_APP_DATA, though this game will probably only go on Android and IOS.

Yay! all code done... now for the fun part, making levels smile
01-07-2014 07:16 AM
Find all posts by this user Quote this message in a reply
Post Reply