Question

I have an application for get and send contacts from blackberry but i need to send only updted contacts instead of all, so can i get only updated contacts from blackberry ?

Was it helpful?

Solution

UPDATE
You can use REVISION field to get last date and time that this contact's information was modified:

long lastChanges = contact.getDate(Contact.REVISION, 0);

So you can save Contacts last change date in Persistent Store and send them to server, next time check actual REVISION value and compare with saved value from Persistent Store.
Remember to handle added and deleted Contacts.

Wrong, tried this approach, REVISION field is not supported by BlackBerry contact list... See also How to Get last contact modification When Revision field is not supported.


Other option is to use BlackBerryContactList.addListener() and PIMListListener, but its rather complex and will require background application running all the time.
UPDATE See example Notify a BlackBerry device application when a contact list changes


Another thing you can do is store Contacts into Persistent Store and compare all fields before synch.
UPDATE You will have to copy Contact field values one by one into some Persistable implementation (I would suggest vector). See A13 – Storing Persistent Data

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top