谢谢:)
答案 0 :(得分:4)
查看MmsSmsDatabaseHelper
的源代码,并注意createSmsTables
方法的实现:
private void createSmsTables(SQLiteDatabase db) {
// N.B.: Whenever the columns here are changed, the columns in
// {@ref MmsSmsProvider} must be changed to match.
db.execSQL("CREATE TABLE sms (" +
"_id INTEGER PRIMARY KEY," +
"thread_id INTEGER," +
"address TEXT," +
"person INTEGER," +
"date INTEGER," +
"date_sent INTEGER DEFAULT 0," +
"protocol INTEGER," +
"read INTEGER DEFAULT 0," +
"status INTEGER DEFAULT -1," +
"type INTEGER," +
"reply_path_present INTEGER," +
"subject TEXT," +
"body TEXT," +
"service_center TEXT," +
"locked INTEGER DEFAULT 0," +
"error_code INTEGER DEFAULT 0," +
"seen INTEGER DEFAULT 0" +
");");
/* rest of implementation not shown */
}
分配给每个sms消息的_id
是PRIMARY KEY
所以是的,它唯一地标识每个sms消息。
答案 1 :(得分:2)
由于它使用SQLite,即关系数据库,因此不可能有重复的标识符。
答案 2 :(得分:2)
SMS_ID对于每条消息都是唯一的。但是还有另一个名为Thread_ID的列,每个对话都很常见,即android手机中的非常对话已经给出了唯一的Thread_Id.But该特定线程中的每条消息都有一个唯一的SMS_ID