Note that there are some explanatory texts on larger screens.

plurals
  1. POUnderstanding architecture of Android contacts
    primarykey
    data
    text
    <p>I am developing an Android app which needs to know when a contact is added/updated/deleted.</p> <p>So I read several posts for it. I understand that we can get notified through Content observers whenever a contacts gets changed, but we can't get which contacts have been added/updated/deleted. So I have read the official APIs and prepared my design how to capture that particular contact.</p> <p>So what I thought at the start</p> <ol> <li>We will store all the contact IDs, deleted flag and version</li> <li>Whenever contacts get changed I will get my table's row count and row count from Android's system.</li> <li>If my rowcount is less than systems row count then a contact has been deleted.</li> <li>If my rowcount is greater than systems row count then a contact has been added.</li> <li>And if these are not the cases then one of the contacts version has been changed.</li> </ol> <p>I have also learned that Android doesn't delete the contact if it is deleted by user, but it sets 0 on deleted flag. So in these cases the row count will be same.</p> <p>Android also changes the row ID of a contact many times as stated in the official docs. So how can we uniquely identify them like lookup uri and if not then we have to put observer for that also. </p> <p>So I want to know whether the above is correct? And in the case a contact is added will it be added to the last row of cursor or not means if I check the last row of system database for contacts will it give me the contact added or not.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload