How to retain the global variebles when application is upgraded to new version in android?

后端 未结 3 665
遥遥无期
遥遥无期 2021-01-24 10:11

In my android application ,user has to register by agreeing the terms and condition giving their email id. If user upgrade the application to next version, I should not get the

3条回答
  •  盖世英雄少女心
    2021-01-24 10:45

    You Have two ways to storing your data @ local media.

    • Shared Preference
    • SQLite Database

    When i should use Shared Preference ?

    If your number of storing variable are not more and it should be primitive values then you can use Shared Preference .

    See This for sample code .

    Or

    When i should use SQLite Database ?

    If you have to store number of variable and which are not primitive and also you need that data for long time then you should use SQLite Database.

    See This for sample code .

    Now its Depends on you as per your requirement.

提交回复
热议问题