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
Highlighted
New Contributor
Posts: 4
Registered: ‎02-01-2012
My Device: Blackberry Torch 9860
My Carrier: Rogers
Accepted Solution

Wireless Communication with Desktop Java Application

Hi, 

 

I am developing a Blackberry application that needs to communicate (sync) with an exisiting Java desktop application over a WiFi network. I have been looking into using JSON messaging to handle the communication between the two apps, but I'm not sure how to go about setting up the initial connection (i.e. sockets?). I'm hoping that someone can point me in the right direction?

 

Thanks.

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

Re: Wireless Communication with Desktop Java Application

welcome to the support forums.

one of the parties has to inform the other where to find it, if it is not a fixed address. for that you could notify the device using email or push, for example.

a bis push with the ip address of your server app could trigger the application to open a connection to the server, for example.
----------------------------------------------------------
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
Developer
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: Wireless Communication with Desktop Java Application

Simon is right that one party is going to need to tell the other how to find it (i.e. its IP address).

 

Given that you have this, then you need to have some processing on your PC that can handle receiving requests from the BB and/or pushing requests to the BB.  Typically BB's will use http communication with a Web Server.  In this case, I'm guessing you don't want to run a full Web Server, in which case a socket connection would seem like the best option - so the BB would talk directly to your desktop application.  There is, included with the tooling you have a SocketDemo which will probably have most of the coding that you need.  So have a look at that. 

New Contributor
Posts: 4
Registered: ‎02-01-2012
My Device: Blackberry Torch 9860
My Carrier: Rogers

Re: Wireless Communication with Desktop Java Application

The SocketDemo was a great starting point. 

 

Thanks for the help.