On AUTO-INCREMENT for DBs in Android

0 views
Skip to first unread message

Nwokedi Idika

unread,
Mar 5, 2010, 10:50:36 AM3/5/10
to purdue-androi...@googlegroups.com
According to this: http://developer.android.com/guide/topics/providers/content-providers.html

If you do not specify auto-increment on your integer valued primary key, in cases where the last record is deleted, the system will reuse that ID.  Specifying auto-increment always increments on the last maximum value.


So specifying auto-increment may or may not be useful for you depending on your application.  A case in which it would be useful is if, your application saves these primary keys, and uses them to interact with the content provider. If the same ID can be used for two users, potentially, this could be bad for your application.

--Nwokedi I.
Reply all
Reply to author
Forward
0 new messages