Question

I have published an application to Google Play store. Now I have update ready, the application uses some serialized objects and the update has changed them a bit, therefore an uninstall before updating is needed.

How do I force users to uninstall the application first or do I have to work this out in code somehow?

Was it helpful?

Solution

I think you should work this out in code. Figure out a way of identifying the old data and converting/upgrading it to your new structures if needed/possible. Even keeping the old object defs around for reading and then converting these in memory to the new structure should work.

One option would be to write some kind of "schema version" pref that at least tells you what the data was written under (missing that pref means it is version 1). At least it will be easier next time.

BTW, the reason I recommend this over just deleting the files is the risk of just repeatedly deleting the files. You need some way of detecting that the files that are there are old (ignorable, deletable or for upgrade) or new and should be kept.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top