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
Developer
Developer
gtj
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Need some help with custom backup/restore via desktop manager

Here's the situation...
 
I have a custom desktop manager addin which syncs fine in both directions with my device-side app.  In order to make this work however, the SyncConverter.convert method has to append a null to each record it writes to the databuffer that gets passed from the device to the desktop.  That's what the examples also do and the desktop code (RIMs or Microsofts) discards the null.  There are no nulls passed from the desktop back to the device during a sync.
 
The problem is that the desktop manager backup process calls the same convert method but doesn't strip the extra null at the end of the records.  The result is that the nulls are stored in the IPD file and when the restore process is initiated, the nulls are sent back to the device, which isn't expecting them.  If I was passing strings back and forth, I could just safely attempt to trim any trailing null but I'm passing data where the last byte in the record could be a legitimate null.  
 
So, what I'm looking for is a reliable way to determine if the device sync process is being called from a sync or a backup/restore. I've got some brute force ways to do it but I was hoping for something "built-in".
 
Any ideas?