views:

153

answers:

2

I need to communicate to a winform app from a blackberry. Most of the development docs talk about webservice, which I am not hosting in my desktop app. Is there any other protocol I can use to communicate from the blackberry device? I was looking at sending very small commands via UDP.

The communication has to be done over WIFI only.

A: 

It sounds like you will need to be listening on a specific port on the computer, then sending commands to that computer on that port over the WIFI connection you'll be able to get them and respond accordingly.

you could possibly use http://www.codeproject.com/KB/IP/TinyUDP.aspx.

John Boker
my issue is, can I send UDP from a blackberry device. I can't seem to find any information on their network stack. I am only finding information on http-webservices.
Saif Khan
+1  A: 

I can speak to the BlackBerry side of things. To open a UDP connection from the BlackBerry use the Connector class in javax.microedition.io. You'll have to specify wifi as the radio interface to use.

The BlackBerry JavaDocs do a pretty good job of outlining things, but say you want to create a send-only UDP connection over WiFi to host 'test' on port 80, something like the following should work:

javax.microedition.io.UDPDatagramConnection connection = (UDPDatagramConnection)Connector.open("udp://test:80;interface=wifi");

Take a look at the JavaDocs for Connector for more information about the connection string format.

Anthony Rizk
do you develope with the Visual Studio plugin?
Saif Khan
No, I never have - so unfortunately re-reading your question I guess my answer wasn't that helpful. If your device will be on a BES it should automatically switch to WiFi when available, regardless of application. For non-BES devices, you'd have to do it manually and I don't know how that's configured with the VS plugin.
Anthony Rizk