i have database with only a counter….i wanted to know how to increment it….
i have seen this article
Increase the value of a record in android/sqlite database
but dont really understand it….
does someone have a code sample which might be useful?
i basically want to make a quotes application…
in that say the user has seen 50 out of 100 quotes and exits the application…
i want to restart from 50 next time the user starts up the application…
is there any other way apart from databases to accomplish this task?
Well I don’t think you want a database. A database contains tables which in turn contain rows and columns. That’s not what you want. You just want to store one single value; the “page” number.
For that you should use the SharedPreferences:
Then when you start your activity, you can retrieve this value like this:
Now if you insist to use a database, you can increment a value like this:
I hope this helps.