Thursday, September 15, 2011

[android-developers] Re: SQLite and JSON or Java object serialization


Well, I found the following link:

http://www.jondev.net/articles/Android_Serialization_Example_%28Java%29

I guess I won't be using JSON and will serialize accordingly. Now I wonder
whether to store the object in a file or in an SQLite database. Since I have
a single object I could probably do away with SQLite.

Any suggestions,

Regards,

John Goche


On Thu, Sep 15, 2011 at 10:04 PM, John Goche <johngoche99@googlemail.com> wrote:

Hello,

I have some Java objects which need to be written to a database while the
user interacts with the application. Such an object has nested objects and I
was considering implementing a proper SQLite representation of the object.
However in another application I just convert to JSON and write the whole
object to the database as a single record. Is there an analogous serialization
mechanism in android so that I may serialize the object and store a single
sqlite record in the database (the serialized objects)?

Any problems with this approach? What classes do I need to use?

Thanks,

John Goche

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment