05-11-2009 01:02 AM - edited 05-11-2009 01:06 AM
sync is triggered by 3 ways:
1. automatically when cradled (how to detect when a device is cradled?)
2. by users on desktop app
3. by users on blackberry app
the sync process should be done on pc and can be triigered from blackberry, right?
can you tell me where I can find a similar example or doc? I read the built-in otasyncdemo example on JDE, but seems not the right solution.
I read BlackBerry Application Developer Guide
Volume 2: Advanced Topics, page num 101, does that meet our requirements?
any help or suggestions would be appreciated. thank you in advance.
05-11-2009 02:22 AM
You can write application which connects to comp using socket/http and sync the data in your specified format.
1. You can write a background application and schedule your sync process.
2. When used try it on PC, you need to intimate the BB device in some event format so that BB device can call the sync process.
3. When user clicks on sync button and call teh sync process.
05-11-2009 04:19 AM
As a general comment, and where BBDeveloper is going, is that people seem to be moving away from syncing at the desktop and thus requiring the user to 'plug-in', instead things seem to be being done via wireless connections. This is particularly useful when the data you want is from a shared (corporate) database held centrally rather than on the User's PC.
However here are some additional answers to your questions.
"(how to detect when a device is cradled?)"
See USB PortListener
"the sync process should be done on pc and can be triggered from blackberry, right?"
I don't that there is a right or wrong answer to this - it depends on how you design it to work.
"can you tell me where I can find a similar example or doc?"
See the usbdemo supplied with the JDE. There are number of Threads related to this demo on this forum what will provide useful information about this too, so search around. For example:
USB Connection to the Desktop
05-11-2009 10:42 PM - edited 05-11-2009 10:53 PM
thank you for your replies
I need to sync via wired connection only, for wireless, we used web service already.
what you meant is that the best approach is usb read and write?
05-12-2009 04:31 AM
I'm not sure I understand why you are asking this question:
"if we use usb reading approach, can we read the data which was saved using blackberry persistent model?"
If you put the data into persistent store, why would you not be able to get it out?
Since persistent store is an Object database, you will need to have access to the Objects used in the Persistent Store, as you will need to serialize them for transfer. There is no Reflection or Serialization functions available, so you are going to have to write this code yourself.
Does this answer the question?
05-12-2009 10:10 PM - edited 05-12-2009 10:44 PM
it is better device should write to and read from xml files? then those can be read from pc via usb connection? besides, I need the two apps can talk to each other, for example:
the sync tool on pc can be triggered by both apps: the app located on device and the app on pc
Thank for your precious suggestions
05-13-2009 04:58 AM
OK, I mis-understood.
What you are suggesting is that this 'sync' application could just use a common format on both ends. I think that is a good idea. Given that you are doing the wireless processing via XML, then I think XML would be perfect.
Also, I think that in an earlier response I mentioned USBPortListener to determine when the device is tethered. Sorry, that is wrong. I think you should use SystemListener2.
05-13-2009 06:44 AM
05-13-2009 08:06 AM
05-13-2009 10:34 PM
Thank you for your answers
because I am new to Blackberry and java
I am not familar with BES, what is it?
finally, we can trigger the tool on pc from blackberry via wired connection , right?