开发者

SQLite: persistent storage of object instances

开发者 https://www.devze.com 2023-03-16 12:04 出处:网络
I started using a SQLite database in my android application. Very simple to use for storing text, integer values or blobs.

I started using a SQLite database in my android application. Very simple to use for storing text, integer values or blobs.

question: how to store an object, e.g. android.location.Location ?

do i have to use serialization or parcable? i've read that parcable must not be used for persistent data storage. but location does not implement serializable.

any difference 开发者_运维问答between storing instances of API classes and my own one?

Thanks in advance


Take a look at Android - How to store Address to DB. You might want to persist just the attributes you care about, and reconstruct Location from them later. For example, storing latitude and longitude if they are all you care about.

0

精彩评论

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