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

New Developer
Posts: 20
Registered: ‎09-24-2009
My Device: Not Specified

Programming a p2p app over wifi



I want to develop an application to communicate two blackberry devices over wifi. Both devices are in the same LAN. Starting with the fact that multicast and broadcast are disabled for UDP packages, so what would be the best solution to make them discover each other (without typing any IP).


I don´t want to include an external server to help them find each other, but if it is the only option...what would be a proper protocol to do so? This will be a discover protocol, once they are both visible, they should make a direct connection.


This is very confusing I'm newbie in BB programming; in iphone we have bonjour to solve this problem. Is there anything in blackberry? I believe there must be some game that needs this too.



Posts: 562
Registered: ‎09-30-2009
My Device: Not Specified

Re: Programming a p2p app over wifi

...why don't you go look at Bonjour? It is an open protocol after all.

Posts: 709
Registered: ‎09-10-2009
My Device: 8520, 8900, 9000, 9300, 9650, 9700, 9780, 9800, 9810, 9900, 9930
My Carrier: Verizon

Re: Programming a p2p app over wifi

Like you said. You can use bonjour if you know how to implement the protocol in the BB. Or you can design your own protocol. It is actually very simple. Each BB registers itself with a known server. The server keeps track of the IP address and port of each BB device for every other device to find. So the server accepts two commands, register and service look up. Also put a timeout in it just in case if the BB does not re-register, the server removes its IP address from the look up table.

Posts: 324
Registered: ‎05-26-2009
My Device: Not Specified

Re: Programming a p2p app over wifi

Perhaps you should also investigate if you can use  BlueTooth to get two devices to discover and talk to each other.

Please do post your insights/thoughts on whatever solution you choose.