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
renuka_anil
Posts: 30
Registered: ‎11-17-2008
My Device: Not Specified

Re: Can't hit an IP address

Thanks. Here im using following format for connecting to server HttpConnection conn = (HttpConnection)Connector.open(strUrl, Connector.READ_WRITE, true); strurl is url to my server http://myserver.com/sampleServlet?type=0 But this is not working in wifi. Is there any paramater to add/set in this format? Is anything to set in device. Please help me for this? Thanks
Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Can't hit an IP address

Have you done what Mark suggested and appended

;interface=wifi

to your URL?

 

I believe this requirement is is also noted in the Network Transports video which I recommend you review if you have not done so.  You can find it here:

http://na.blackberry.com/eng/developers/resources/videolibrary.jsp#tab_ddetail_subtab_jde

Please use plain text.
New Developer
renuka_anil
Posts: 30
Registered: ‎11-17-2008
My Device: Not Specified

Re: Can't hit an IP address

Sorry. I thought ;interface=wifi is applicable to socket connection only coz in example it is mentioned like that.

By simply appending this string in url, the httpConnection can work in wifi also. In that case my url become

http://myServer.com/sampleServlet?type=1;interface=wifi

 

is that correct?

 

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Can't hit an IP address

It is correct.  Mark was telling you this would work when he said:

"Wi-Fi connections are not limited to just socket connections."

Please use plain text.
New Developer
renuka_anil
Posts: 30
Registered: ‎11-17-2008
My Device: Not Specified

Re: Can't hit an IP address

Thanks.

 

The RadioInfo class retuns the available network. If I get NETWORK_802_11  then it is Wifi and if signal level is ok then i can use url for wifi else i can use url without wifi.

 

Is that correct?

 

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Can't hit an IP address

This is something that I have not tested, so sorry I can't say it is correct, but I can see no reason why what you are suggesting would not work.  If you try it and it does work, please let us know as this is something on my list of things to try.

 

However you probably don't have to be that clever because the BlackBerry device should automatically route requests over WiFi if it can.  So you stick to ";deviceside=true" and it should go WiFi when it can.  However you might want to give your user a "WiFi only" option and then checking it would be useful.

Please use plain text.
New Developer
renuka_anil
Posts: 30
Registered: ‎11-17-2008
My Device: Not Specified

Re: Can't hit an IP address

No my application will be running all devices. It may be wifi, edge, gprs, t-mobile anything. But one build is running on all the devices.

So you are saying by keeping deviceside=true it wll work for all wifi, gprs both.

 

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Can't hit an IP address

Sorry I can't give you a definitive answer, because I don't work for Rim, so I'm not sure what the code is supposed to do, only what I have seen it do.  Also note, because I am in the UK, which is GPRS only, I've not tested CDMA networks.  I suggest you start a new Thread and ask the specific question, i.e. for a connection with ;deviceside=true, if the WiFi enabled phone does come into WiFi coverage, will it automatically route the request over WiFi?

Please use plain text.
Administrator
MSohm
Posts: 14,560
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook

Re: Can't hit an IP address

I've answered this in the new thread found here:  http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=14460
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.