开发者

android bestway to keep temp data

hi in my application i have temp data , i need to keep th开发者_运维百科e data only up to a particular condition , when app meet this condition,i don't need the data anymore. my problem how to keep the data,upon resuming the application


Using shared preference is the best way


You could try storing data in a sqlite database - there are lots of examples around the internet about how you can use sqlite database in an android application :

http://developer.android.com/guide/topics/data/data-storage.html

http://www.screaming-penguin.com/node/7742

or, you could store stuff in xml files

http://www.ibm.com/developerworks/opensource/library/x-android/

if you store data in xml or an sqlite database - the data is persistent until you specifically remove it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜