1. Stock Android will never reattach a deleted raw contact to a contact

2a. Contacts sync physically deletes the data from the raw_contacts and data
tables.
2b. Removing the account will physically delete the data.
2c. Before you sell the phone, you should always do a factory reset - you
don't know which applications are keeping private data. You should also
reformat the SD card.

3. Stock Android automatically combines raw contacts into aggregate contacts
using a complicated set of criteria.

4. The DIRTY attribute is designed to help sync adapters tell which contacts
have changed.  This flag is reset by the sync adapters.  If you are writing
anything other than a sync adapter - reliably detecting changes would be
difficult.  Keeping track of the version is not a bad idea, except that
version would be reset if the contacts database is rebuilt for some reason
(e.g. account removed and re-added).

Cheers,
- Dmitri

On Fri, Nov 5, 2010 at 11:31 AM, Bassel Kh <[email protected]> wrote:

> Hello folks,
> I'm building backup\restore software for contacts using Android 2.1, I
> understood the structure; I mean the relation between Contact,
> RawContact, and Data.
> http://developer.android.com/resources/articles/contacts.html
>
>
> I checked the database (contacts2.db) and after studying it I found:
>
> 1- when you delete a contact; its row from contact table is deleted.
>
> 2- Its (Raw contact) rows remain as they were, but the
> (RowContact.contact_id) will be set as null (break the relation with
> Contact table) and the flag (RowContact.deleted) is set as 1.
>
> 3- Also its (Data) rows remain as they were,but the
> (RowContact.contact_id) will be set as null (break the relation with
> Contact table).
>
>
> My questions:
> 1- Under which criteria Android reverts or reattach a contact id with
> a raw contact rows?
> 2- Do you see that this is security breach since I can buy a second
> hand Android phone and query the contact database and see all the
> (Deleted Contact) data?
>
> 3-Under which criteria we can get (Contact has more that one raw
> contact) attach to it?
> I found the feature (Link) so you can link more than one contact
> together, is there any other feature that creates (contact with more
> than raw contact) scenario ?
>
> 4-What is the best way to identify that a contact has been changed?
> currently I'm using (RawContact.version) to track if there is a change
> on a raw contact.
>
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to