如何以编程方式向 Android 中的联系人添加邮政地址?
我正在开发将联系信息添加到 android 联系人列表的应用程序。如何以编程方式将邮政地址添加到 android 中的联系人?
I am developing app which add contact info to android contact list .to How to add postal address to contacts in android programmatically ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题已经有一段时间了,但也许其他人仍然对此感兴趣。如何添加带有地址信息的联系人:
请注意,某些设备(例如三星 S5 / A5)会将整个地址放入“街道”字段中。如果您对此有任何优化,请告诉我。
It's been a while that this has been asked but maybe someone else is still interested in it. How to add a contact with address info:
Note that some devices like Samsung S5 / A5 will put the whole address into the "street" field. If you have any optimizations for this let me know.
邮政地址与所有其他信息一样存储在 DATA 表中,
请通过 Google
ContactsContract.CommonDataKinds.StructuredPostal
查找所有信息。如果您需要了解如何编辑联系人,我建议您查看 Android SDK 中的 SampleSyncAdapter。它是一个同步适配器,因此您不需要研究所有内容,但 ContactManager 中的 updateContact 是一个很好的起点。
Postal address are stored like all the other info in the DATA table with a
Please google
ContactsContract.CommonDataKinds.StructuredPostal
to find all the info.If you need to know how to edit a contact in general I would suggest you to have a look to the SampleSyncAdapter in the Android SDK. It is a sync adapter so you don't need to study everything but updateContact in ContactManager is a good point to start with.