How to use contact API for Android 1.x and 2.x at the same time?

Mi's problem is that I need to implement Contact List in my application for android 1.5, 1.6 and 2.x.

I did this using the old Contacts API, not ContactsContract due to backward compatibility with 1.x. But when displaying my application on 2.x, the contact list is not complete. On some devices, it appears as empty, and on some devices it displays only some of the contacts on the device.

I know that when using the Contacts API in the 2.x series, only the main contacts of the account will be displayed, but this is not so. It seems that only recently updated contacts are displayed, but this is also not the case.

So the question is: how to properly implement the contact list for versions 2.x and 1.x for Android?

Thanks in advance

+3
source share
1 answer

But when displaying my application on 2.x, the contact list is not complete. In some devices, shown as empty, and in some devices, only some of the contacts in the device are displayed.

Correctly. The old contact API only supports contacts stored exclusively on the device, and not those obtained through synchronization with other providers. There was also a bug with Android 2.0, where you didn’t even get locally saved contacts, although this was fixed using Android 2.0.1 IIRC.

So the question is: how to properly implement the contact list for 2.x and 1.x version for Android?

, (, Uri), , .

, ( ) , API, . .

+7

Source: https://habr.com/ru/post/1733920/


All Articles