WEB开发网
开发学院手机开发Android 开发 Android 获取短信会话列表 阅读

Android 获取短信会话列表

 2011-01-11 07:16:53 来源:WEB开发网   
核心提示:列名则为:private static final String[] ALL_THREADS_PROJECTION = {"_id", "date", "message_count", "recipient_ids", "snip

列名则为:

private static final String[] ALL_THREADS_PROJECTION = {
	"_id", "date", "message_count", "recipient_ids", "snippet", "snippet_cs", "read", "error", "has_attachment"
};

其中:

1、message_count为该会话的消息数量;

2、recipient_ids为联系人ID,这个ID不是联系人表中的_id,而是指向表 canonical_addresses 里的id,canonical_addresses这个表同样位于mmssms.db,它映射了recipient_ids到一个电话号码,也就是说,最终获取联系人信息,还是得通过电话号码;

3、snippet为最后收到/发送的短信;

每个数据的类型嘛,大致为:

long id = cursor.getLong(ID);
long date = cursor.getLong(DATE);
long msgCount = cursor.getLong(MESSAGE_COUNT);
String recipIDs = cursor.getString(RECIPIENT_IDS);
String snippet = cursor.getString(SNIPPET);
long snippetCS = cursor.getLong(SNIPPET_CS);
long read = cursor.getLong(READ);
long type = cursor.getLong(TYPE);
long error = cursor.getLong(ERROR);
long hasAttach = cursor.getLong(HAS_ATTACHMENT);

上一页  1 2 

Tags:Android 短信

编辑录入:coldstar [复制链接] [打 印]
赞助商链接