上次修改联系方式的时间
有没有办法找出上次修改联系人的时间? 我似乎找不到它的变量。我问这个问题的原因是因为我想将联系人同步到我的网络服务器,并且我不想使用 HTTP 请求检查每个联系人是否需要更新。
所以我想检查上次更新的日期到上次同步的日期。
is there a way to find out the last time a contact was modified?
I can't seem to find a variable for it. The reason I'm asking is because I'd like to do a sync of the contacts to my web server and I don't feel like checking for each contact with a HTTP request if it needs updating.
So I was thinking to check the date of the last update to the date of the last sync.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没有找到办法做到这一点。我可以存储上次同步日期,但无法检查此后联系人是否已更新。
编辑:
联系人有一个 DIRTY 标志,如果联系人已更改且未同步,则该标志设置为 1。
Didn't find a way to do this. I can store the last sync date, but no way of checking if the contact was updated since then.
EDIT:
the contact has a DIRTY flag, which is set to 1 if the contact was changed and not synced.
我知道这是一个旧帖子,也许可以帮助其他人......
您可以使用一个名为 CONTACT_LAST_UPDATED_TIMESTAMP 的属性:
https://developer.android.com/reference/android/provider/ ContactsContract.ContactsColumns.html
I know its an old post, maybe help others...
There is a property calked CONTACT_LAST_UPDATED_TIMESTAMP that you can use:
https://developer.android.com/reference/android/provider/ContactsContract.ContactsColumns.html
根据您的需要,您还可以自己缓存
ContactsContract.Contacts.Entity.VERSION
(针对与联系人关联的不同原始联系人),并将其与 Android 中的当前值进行比较。内容提供商。Depending on your needs, you might also be able to cache
ContactsContract.Contacts.Entity.VERSION
yourself (for the different raw contacts which are associated with a contact) and compare it to the current values in the Android's content provider.