Skip to main content
Participant
August 15, 2011
Question

Saving app data on mobile devices?

  • August 15, 2011
  • 1 reply
  • 478 views

Hey, I want to make a save file for the game I'm making for iOS and Android, but I'm not sure how to go about doing it.

Should I make a text file? Where do I store it/read it from? Where does it go?

Any help would be greatly appreciated.

-Thanks in advance.

This topic has been closed for replies.

1 reply

Participating Frequently
August 15, 2011

The application storage directory is a good place for saved game files.

The format is whatever you find easiest to use. Both text and XML work. You can also write a save game object to a byte array and save that to a file.

Instead of reading and writing a file yourself, you could use a local shared object.

Participant
August 15, 2011

Ok! Thanks a lot. One last question.. how can I find the application storage directory for each device? Or will a shared object take care of that for me?

Participating Frequently
August 15, 2011

The shared object takes care of itself.

If you want to read/write the file yourself, you can use File.applicationStorageDirectory like this:

var saveFile:File = File.applicationStorageDirectory.resolvePath("save_file.xml");