Integer Primary Key Autoincrement

The AUTOINCREMENT descriptor is optional. But without it, SQLite increments an ID counter field to the next number above the largest existing number in the column. If you delete the last row, the next row added will have the same ID as the deleted row. AUTOINCREMENT avoids this by having SQLite increment to the next largest value whether deleted or not.

• Carefully document the data type of each column. Clients need this information to read the data.

• If you are handling a new data type, you must define a new MIME type to return in your implementation of

ContentProvider.getType() . The type depends in part on whether or not the content: URI submitted to getType() limits the request to a specific record. There's one form of the MIME type for a single record and another for multiple records. Use the Uri methods to help determine what is being requested. Here is the general format for each type:

0 0

Post a comment