Application backup and application synchronization

I am working on backing up contacts and syncing.

The goal is to send all the information about all contacts to the server (special protocol) as a backup.

At the first launch of the application, all contacts will be queued and sent to the server. After that, background maintenance will be performed, which will listen to a new update of contacts / contacts, and this new / updated contact will be sent to the server by the background service.

I am using RawContactsEntity to get records.

I tried using ContentObserverRawContacts / Data in the tables to get notified when a contact was added or a contact was changed. But, AFAIK, ContentObservergives notice ( onChange()) of the changed data in the table as a whole, and not the identifier of an individual record.

Now my problem is how to get the exact id of the modified / new entries?

I thought about creating a backup table to compare with the table of native contacts and getting changed records. But as the number of contacts increases, performance will dramatically deteriorate, and this will also make battery life more difficult.

Can you suggest me the best way to achieve this contact backup operation in terms of performance and memory usage? Is there any other way to sync contacts?

, - , .

+5
1

(AccountManger), Android . , , reset . - ( ), RawContacts , . , . , Google Google .

0

All Articles