Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 96
Registered: ‎07-26-2008
My Device: Not Specified

Detecting end of bulk contact book syncing event

[ Edited ]

 

We have an application that adds contacts from the native contact book to our application contact list for sharing actions etc.

 

When the application first launches it does a bulk sync with the native device contact list.   Thereafter it adds a PIM listener to track any changes to native contact list and acts on it immediately inside our application.

 

There are cases however when a user subsequently adds a new email account, say gmail , and enables synchronization of contacts. Immediately  thousands of events may be fired for new contact adds depending on how many entries the gmail account had.   As our application is written to act on each event as it occurs, it kills the performance of the app and device as each of the contact added event requires some processing and a network hit on our side.  1000's of these hits back to back occur and this is not desirable.

 

How do people handled these kinds of scenarious?

 

We would like to batch up all these requests and handle then once - however for this we would need to detect when the end of the synchronization process has occurred.

 

We looked for a new contact list/group added event, so we are able to detect the begining of this process.  However, there is no reliable way to detect the end of the contact book synchronizing event.

 

We found the following API that purports to do this, however we have not been able to use it to fire the requisite events and it is is not clear that if this  OTA event is fired for the case of email address based contact book synchronization that occurs with gmail etc or if it is for something else.

 

http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/synchronization/SyncEventListe...

 

Does anyone have any sample code that can show us how to handle the begin and end of a bulk contact book synchrnonization process ?

 

Other approaches, work around to handle this situation will be appreciated.

 

Developer
Posts: 16,643
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Detecting end of bulk contact book syncing event

afaik the SyncEvents are something else, monitoring OTA sync of data stored in http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/synchronization/OTASyncCapable...

 

i don't think there is an API for what you want. Maybe you could queue events and check for the timestamp, if there don't come any new ones for a certain time you process them.

Quite a complicated solution with lots of overhead, though.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter