【发布时间】:2015-01-24 10:40:03
【问题描述】:
使用 SL4A 和 Python,有没有一种简单的方法可以从电话号码中获取联系人 ID?
电话号码来自短信的“地址”字段。
我试图避免搜索所有联系人。
我使用m = droid.smsGetMessageById(id, None).result 来获取短信。结果如下:
{u'read': u'1', u'body': u"Hello! Your mobile bill's now ready to view at virginmobile.co.uk/youraccount. We'll collect your Direct Debit of 12.12 on or just after 19th Nov.", u'_id': u'1323', u'date': u'1415372649502', u'address': u'1234567890'}
address 条目中的值是发送 SMS 的电话号码。
我想使用此号码获取联系人 ID,但如果可能,我想避免搜索我的所有联系人。
【问题讨论】:
-
请添加一些输入和预期输出
标签: android python android-contacts phone-number sl4a