I created a table named resources but when I insert values in it, this exception is thrown:
android.database.sqlite.SQLiteConstraintException:
error
In order to get more information about SQLite errors, one can use ADB dumpsys:
adb shell dumpsys dbinfo -v
combined with grep:
adb shell dumpsys dbinfo -v | grep executeForLastInsertedRowId
or grep'ed twice:
adb shell dumpsys dbinfo -v | grep executeForChangedRowCount | grep failed
Constraint failed usually indicates that you did something like pass a null
value into a column that you declare as not null
when you create your table.