Android App Updating Without Losing Data

前端 未结 3 486
栀梦
栀梦 2021-01-18 04:01

I\'m new to Android development, so I\'m trying to do an app that stores information about a warehouse. However, I\'m afraid that if I perform an update, the user data will

3条回答
  •  無奈伤痛
    2021-01-18 04:48

    1) No data will be lost during an upgrade, only when you uninstall the app. But be very careful if you change the data format between versions, you'll have to implement some migration code.

    2) SQLite data is safe across upgrades, including Android system upgrades. However, Serializable is not. Never use Serializable to persist data reliably in the long term. Use something like JSON, XML or protocol buffers to serialize your objects.

提交回复
热议问题