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 android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to