存储数据的最佳方式 [英] Best way to store data
问题描述
我需要存储我的应用程序的一些照片的相关信息。据我了解,你可以读/写的GPS定位和形象的描述已经到图像内容提供商。
I need to store some Photo related information for my app. I understand that you can read/write GPS location and image description already to the Image Content Provider.
我还需要增加对云同步,即字段(标志)与正在更新和需求同步...等
I would also need to add fields (flags) for cloud synchronization, i.e. with 'UPDATING' and "NEEDS SYNCING"... etc
我可以添加额外的列到默认的图像内容提供商来存储这些标志?如果没有什么是存储它们的最好方法是什么?
Can I add additional columns to the default Image Content Provider to store these flags? If not what is the best way to store them?
我在想建立我自己的SQLite表,但我只需要存储这些标志一个或两个字段,在我看来矫枉过正。
I was thinking about setting up my own SQLite Table, but as I only need to store one or two fields for these flags, it seems to me an overkill.
推荐答案
您可以用共享prefrences
简短,简单而甜蜜去。你只需要东西来照顾它是指变量值的关键,并为共享preference必需的。
you can go with the SharedPrefrences
short, simple and sweet. Only thing you need to take care of the key which is referring to the tag value and required for shared preference.
您可以对学习从这个链接,的http://saigeethamn.blogspot.com/2009/10/shared-$p$pferences-android-developer.html
You can learn on that from this link, http://saigeethamn.blogspot.com/2009/10/shared-preferences-android-developer.html
我希望它可以帮助你。
这篇关于存储数据的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!