As Lior pointed out, you can't just stuff object-oriented data into a
SQL database magically.

You have to somehow convert the data into a format that can be
stored.  There are lots of options here but they all require extra
work:
1. Manually convert your object into multiple columns of basic data
types
2. Use a framework like Hibernate to do the work for you (but this is
overkill for small objects)
3. Serialize your object into binary data and store it in a blob/image/
binary data field.  However, this is kind of a dumb solution, because
you wouldn't be able to query your data (unless you deserialize every
row), and if your data object structure changes then you have to worry
about versioning, etc.

-- PJ


On Nov 18, 12:38 am, 097 <[email protected]> wrote:
> See details in the docs under <SDK_DIR>/docs/guide/topics/data/data-
> storage.html and I think you'll find the answer
>
> You should implement SQLiteDatabase.CursorFactory interface, and
> create an SQLiteDatabase instance by calling the static method
> SQLiteDatabase.openOrCreateDatabase.
> Details info of SQLiteDatabase.CursorFactory is in <SDK_DIR>/docs/
> reference/android/database/sqlite/SQLiteDatabase.CursorFactory.html
>
> On Nov 18, 2:06 pm, naveenballa <[email protected]> wrote:
>
>
>
> > i have a class like
> > class Mydata{
> > String name;
> > int data;
> > Location[] locarray;
>
> > }
>
> > List<Mydata> = new ArrayList<Mydata>( );
>
> > can anyone tell me how to add the object of Mydata class to Sqlite
> > Database column
>
> > Thanks in advance- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en

Reply via email to