0

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?

urSus
  • 12,492
  • 12
  • 69
  • 89
  • What do you mean with serialized objects? wiping your shared preferences should be enough, or are you storing some custom object-files on the sd? – Robert Estivill Nov 27 '12 at 01:32
  • serialized arraylist, in internal storage – urSus Nov 27 '12 at 01:34
  • so, why don't you just delete the files the first time you run your new app? It would have the same effect than asking the user to uninstall the app – Robert Estivill Nov 27 '12 at 01:37
  • well because its I want to persist it outside activity lifecycle. Ill have to figure out in code, I just wanted to know if there is an easier way, thanks – urSus Nov 27 '12 at 01:47

1 Answers1

1

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.

DrC
  • 7,528
  • 1
  • 22
  • 37