views:

958

answers:

3

Hello,

I am debugging the Blackberry application using Eclipse -> Debug as -> Blackberry device

Whenever I try to establish socket connection with the server in LAN , I get IOException and I am not able to connect to LAN server through real device.

I am using Blackberry Pearl 8100 device.

Please help.

A: 

You need to install the blackberry mds simulator - then you can get network connections.

NB. When you have a production version of your app: you should note that not all blackberry devices will allow network connections - it will depend on which servers they use.

Grouchal
how do I manage mds simulator and real device?
imMobile
Not sure what you are asking about managing MDS? You can download it from the blackberry developer site - then install it - then you run it in the background. For production code on real devices - just beware of the problem - as I don't know your situation it may not be a problem for you. A single app on a single device - unlikely to be a problem - a commerical app on many devices - you will likely need a partnership with RIM to get it approved to work on all devices.
Grouchal
A: 

I need a bit more information - the message in the IOException is important - it'll have some information about why the connection failed.

Assuming that your device is connected to a BES, and has a data plan, you should be able to connect to a server on your LAN. Do you know if your device has any connectivity issues? Can you test a connection to the same server using the BlackBerry Browser? It may also have to do with IT Policies on the BES.

Anthony Rizk
First of all,I dont know the stack trace of exception is not printed on the console.I get "no stack trace".Secondly,I have a full fledge functioning device with good data plan.I connect the device to computer usb port,the simulator allows me to establish connection to another pc in network having LAN ip(not a public ip)If I connect BB device thru usb,I should be able to connect to same n/w,I guess...which I coudn't...
imMobile
Ok - I understand the problem I think. I've posted another answer that should be a better fit.
Anthony Rizk
A: 

Based on further comments and discussion, I think this is a better answer:

A BlackBerry device will only automatically route a network connection through the USB port (and so to the local LAN) if the device is activated on a BES.

If the device is a non-BES device, you require special code to do a USB connection - i.e. if you're plugged into USB your device will still attempt to use its radio to make the network connection.

Anthony Rizk