How to keep data when user upgrades his app?

I’m working on an app that has some user saved data (an array with strings that can be saved to sqllite).

What is the best way to keep the data on the user’s device when he upgrades to a new version of my app? [import]uid: 33608 topic_id: 17470 reply_id: 317470[/import]

Upgrades shouldn’t delete data stored in the system.Documents directory. From my experience, the only way to delete data from that folder is to delete the app and re-install fresh. J-random upgrade should leave user data alone.
[import]uid: 19626 topic_id: 17470 reply_id: 66327[/import]

I think that Peach’s Tutorial may be able to help you…

http://techority.com/2011/04/02/how-to-save-and-load-data-in-your-app/

[import]uid: 86879 topic_id: 17470 reply_id: 66339[/import]

@amir, I guess I would be kind of repeating what Rob has said.

Apps are identified internally on the Android or iOS by their ID, which would be something like com.ozapps.appname (for example)
The data that is stored is in a sandbox that is assigned a GUID by the system.

When you upgrade without changing this ID (com…) then the directory would be the same and the data remains, just the resources and other directories are updated.

However if you delete the app, then the data gets deleted as the entire sandboxed directory is deleted including the files that you have created.

You can upto an extent (if you backup) restore the user data if you do delete the app.

@Swello, the link that you are suggesting is for *creating* user data which is totally different from App upgrades or what Amir has asked for.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 17470 reply_id: 66365[/import]

Thanks everyone. It’s good to hear that its that simple! [import]uid: 33608 topic_id: 17470 reply_id: 66379[/import]

Swello, thanks for linking to my site but that particular post is not the most efficient way to do things - it was more about experimenting as a new user and just making things work.

Amir, I’d suggest you look at Jonathan Beebe’s Games Class or ICE, which I haven’t used but have heard good things about.

Peach :slight_smile: [import]uid: 52491 topic_id: 17470 reply_id: 66392[/import]