Page 1 of 1

How would you update a mobile app?

Posted: Fri Dec 28, 2012 2:59 pm
by macthorman
I have a very general question regarding the update procedure of Android apps. Imagine I am publishing a game including different levels and a sql file that stores the highscore and the progress of the player. As far as I understood, uploading a new .apk file to the Google Playstore would completely replace the app previously installed and this would also include the sql file with the player information. This would result in the loss of the player's highscore and in-game progress. I know that the creation of an online player account and storing the data in an external database would be a solution but this is a lot of work.

Is there an easier way to update an app without loosing important player information ?

Re: How would you update a mobile app?

Posted: Fri Dec 28, 2012 6:57 pm
by dave_probertGA6e24
Hi,

Just save the sql file in the user "documents" folder on the device. That folder should be away from the actual App and therefore not overwritten with an update.

It's actually quite easy to do. Use the "specialFolderPath" to point at the right place (look it up in the dictionary, or here on the forums)

The only 'fun' part comes if you want to change the layout/format of the save information at a later date - to do that you will need to have a small function that will check if there is an old sql file and if so to load it's data up and re-save it in a new format. Set a flag variable and save that in a separate file in the docs folder too - the flag will let the code know which version of the save file it is (obviously you will need to handle this aspect as well!) There are many aspects to user data that should be thought through before releasing an App, but if you get it thought out first then you have a lot less hassle later :)

Cheers,
Dave

Re: How would you update a mobile app?

Posted: Sat Dec 29, 2012 8:03 pm
by macthorman
Hey Dave,

thanks for the info this is exactly what I was looking for :wink:

Cheers