how to store list into sqlitedatabse?

I need to store list of contacts into sqlite database. I've displayed contacts in my project application using Contacts Content Provider. I just need to store the list from emulator into database. Anyone knows how? please help thanks.

Answers


Not a big deal.

Transfer your ContactModel into a ContentValue:

ContentValues values = new ContentValues();
values.put("name", name);
values.put("number", number);

then insert it in database :

database.insertOrThrow(databaseTable.getTableName(), null, values)

But keep in mind that it will always be as fast to get a contact from SQLite database as from the ContentProvider since it's pretty the same tech.


Need Your Help

SKPhysicsbody error on collision swift

xcode swift skphysicsbody

i have to following code that makes a custom physicsBody for my enemy.