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 agreement page or email registration window. I am controlling it using global variables but if user upgrade application to newer version, global variables get reset, so user get the agreement page and registration window again. So how can I do this? Thanks for help in advance.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Handling ffmpeg library interface change when upgr
You could use SharedPreferences
I use this piece of code to display the ChangeLog in my app to detect if the version has changed and display the ChangeLog accordingly. The same logic can be used for displaying or not displaying the Agreement, as the case may be.
These are my Global Declarations:
EDIT: Alongwith this code, I also use a
Preferences
XML file to provide the use the ability to see the ChangeLog again and also store the state of the user preference to display the ChangeLog at next run. The XML for that: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.