Maybe this is not in the scope of this forum... But is there a time
and place for serializing an obj and then saving it to a DB vs saving
it's members? I am trying to get out of the saving and loading of each
member that I declare. Is serialization a bad(lazy) route?

On Aug 29, 11:58 pm, Mark Murphy <[email protected]> wrote:
> Greg Hedin wrote:
> > Is it possible to pass a serializable object to SQLite using the ole
> > 'android.content.ContentValues' class? I am making a to-do-list
> > application and I rather than writing a 'put' line for each member of
> > my task object, I want to send the whole object to sqlite and move
> > on... this makes things more manageable later on when I decide I
> > designed my app poorly and need to change my class around. :P
>
> Serialization usually makes this worse, not better, IMHO.
>
> > I have found Java Serialization to mySQL examples, but no sqlite
> > examples. I am new to the concept of Serialization in Java and I've
> > heard that you can get your object to be represented as a double, this
> > may be a solution for me.
>
> Serialization does not get your object to be represented as a double. It
> gets written to a stream, which typically writes to a local file:
>
> http://developer.android.com/reference/java/io/ObjectOutputStream.html
>
> You can probably arrange a way to have the stream dump to a byte[] and
> store that in a BLOB column. Or, don't use SQLite -- I seem to recall
> there is at least one object database for Android available.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Development Wiki:http://wiki.andmob.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to