Domanda

So I have discovered that an app can be updated whilst the app is in mid-use. My app records a workout and stores values into a local DB before uploading the workout.

During the last update, we altered the databases, adding new tables and columns. A certain number of users had their app update mid-workout, corrupting the database. While that can be fixed after the fact, it doesn't change the fact that the user has lost that workout. I've been searching but haven't yet found something that would allow for the app to wait on the update until it isn't in use.

Any suggestions are welcome.

Thank you for your time.

È stato utile?

Soluzione

You can't stop the update, but you can make sure, there is no corruption, and there is no data lost: Before Update, the application's onPause() callback will be called - time to make sure, the App is in a recoverable state. This might include storing the momentary working set to some temp storage. After update, the app will receive onResume(), where you can load the working set back.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top