• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android Two (or more) games share the same save file (ini)?

S

Savatar

Guest
Greetings GM Community,

Is it possible 2 different Android Games (uploaded normally at Google Play, with Different .keystores etc.) to share the same save file? To be more specific, for my applications I use .ini files to store variables, stats etc. Is it possible one application to check and find the ".ini" file of another application and read the variables, so they will "share" the same save file? I can't figure out where exactly (directory) the save files are at Android devices (at Pc is more simple, I know). Imagine a game has 2-3 different versions but all of them sharing the same save file (ini)

Thanks a lot for your time, and sorry for my clumsy English.
 

Tsa05

Member
Nope.
Basically, it's a security thing; when an app on your device wants to write files, the Android operating system provides a special folder for that unique app to use for writing. This way, it's impossible for viruses or other badly behaving software to interfere with any other apps. On Windows, there's a way to prompt the user for permission to touch other folders, but not on Android. *Technically*, there's Android permissions setting that can grant your app similar abilities, but GameMaker does not have an implementation of this.

The only only way I can think of would be to have your game send the save data to an online server location that both things can access. Maybe YYG can address whether there's a plan to implement wider file system access at some point, or perhaps other forum members can recommend an extension of some kind?
 
S

Savatar

Guest
Thanks for the quick reply. Would be extremely useful to see such an option at future. Gives a lot of flexibility for the creator, f.e. to have a game at different versions but gamers will not lose their progress when they switch at them. Or if you lose your .keystore file (yes, some newbies creators do that silly mistake) you can still update the game and gamers will not lose their old save. Or even connect 2 games (read the variables from the 1st game and set the ones of the 2nd game according to player's choices). Anyway, thx again for the reply :)
 

Humayun

Member
It is possible if you save your files in external storage ( not inside your app save directory but in SD Card or Device Storage ) and use many other apps to access them just like Photo Apps access all your photos on your phone. GMS gives option to save files there, I tried it long time ago and succeeded to save and load files from device storage. I used to direct paths to access files something like /storage/sdcard0 for this but I am not sure there are some posts on stackoverflow about android storage paths take a look at them.
 
Top