My mate made the database for my Android app. For example, one of the tables is created like this:
CREATE TABLE table1(
id_fields_starring INTEGER PRIMARY KEY AUTOINCREMENT
, fields_descriptor_id INTEGER NOT NULL
, starring_id INTEGER NOT NULL
, form_mandatory INTEGER NOT NULL DEFAULT 1
, form_visible INTEGER NOT NULL DEFAULT 1
, FOREIGN KEY(fields_descriptor_id) REFERENCES pr_fields_descriptor(id_fields_descriptor) ON DELETE CASCADE ON UPDATE CASCADE
, FOREIGN KEY(starring_id) REFERENCES starring(id_starring) ON DELETE CASCADE ON UPDATE CASCADE
)
From the fields of a table I need to know which of them is INTEGER NOT NULL and which is INTEGER NOT NULL DEFAULT 1, because for the first case I must create dinamically an EditText and for the second case I must create a CheckBox. Any idea?
Calling:
will dump the table information, e.g.
and simply find the row in the cursor with
notnull=1anddflt_value=1Edit:
To list all columns defined as
INTEGER NOT NULL DEFAULT 1this would work (helperis your instance ofSQLiteOpenHelper):