Android: SQLiteDatabase & ContentValues inconsistencies

Here I will list the consistencies or problems that I ran into working with Content Values and SQLiteDatabase in Android.

  1. ContentValues.getAsBoolean(key) will always return false as SQLite cursor returns 0 or 1 for Boolean fields. And ContentValues treats both the integers as false. So, you need to get it as integer and convert it yourself.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s