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
conundrums
Posts: 6
Registered: ‎10-16-2008
My Device: Not Specified

J2ME Sync with a communication server

Hello,

My J2ME application stores some XML files in SD card. A user need to transfer those stored files to a communication server and synchronize them whenever he/she wants to.
I am wondering if J2ME provide those sync service with a communication server.
If available, where can I find samples?

Thanks in advance.
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: J2ME Sync with a communication server

Are you talking about just checking date/time or trying to merge/reconcile the contents record by record?

For example, you can use the http caching mechanisms to determine if you have a stale copy or need

to update the server but presumably you would need your own code to do finer grained stuff. I guess you could

use the DOM classes but AFAIK you need to do your own choosing etc.

Please use plain text.
New Developer
conundrums
Posts: 6
Registered: ‎10-16-2008
My Device: Not Specified

Re: J2ME Sync with a communication server

Hello,

 

My scenario of syncing with a communication server is as follows.

 

1) if a communication server already has an old XML file comparing to a file in a SD card, the blackberry send it to a communication server and overwrite it.

2) if a communication server does not have an XML file that a blackberry owns in SD card, the blackberry send it to a communication server.

 

Any advice using J2ME?

 

Thanks for your reply.

Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: J2ME Sync with a communication server

I'm not really sure what you expect to find but you can imagine the hazards here. I'd imagine POST/GET should

work but you probably want to pass around some cookies to avoid problems. If you are the only accessing it you

know how old it is, if not you need some mechanism to avoid users stepping over each other. I'm not

sure if there is a J2ME API that handles stuff like this although I guess syncing-up is a common activity

on devices not designed as primary data repositories.

Probably the cheapest thing to do is ask the server if your file merits upload and if so get back a cookie that

locks out other potential updaters until you are done and then post your update.

 

 

Please use plain text.