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
Developer
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810
Accepted Solution

Blackberry data networking (WiFi in particular)

A confused mind is a working mind!

 

Here's what I recently discovered about Blackberry, and not a very pleasant discovery, I am compelled to add.

 

When not having a BB dataplan, you cannot use WiFi from you application.

 

It seems RIM was generous enough to give the BB data plan users option to cut costs on their data plan spending by enabling them the usage of WiFi.

WiFi is thus used only as a second hand for the 'privileged' users.

 

If you don't have data plan, you will not be able to utilize (what whould otherwise be normal) WiFi connectivity.

 

I have tried numerous scenarios with/without the BB data plan and have come up with that conclusion. Among others, the best tool used was the famous 'Network diagnostics' tool.

 

Has anyone had success in using WiFi (pragmatically, of course) on a non-data plan enabled device ?

 

In conclusion: The white WiFi icon is preffered over the gray one Smiley Wink



"Listen carefully, I shall say this only once"
Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Blackberry data networking (WiFi in particular)

a quick google search netted some interesting articles about it, like
http://www.ehow.com/how_4537240_using-wifi-data-plan-t.html

i think peter strange mentioned some times that he uses a device without a dataplan, only wifi enabled, for testing.
----------------------------------------------------------
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: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Blackberry data networking (WiFi in particular)

I disagree. I have BlackBerrys with SIMs that have no BlackBerry data plan and WiFi works just fine. I suspect you may have forgotten to append deviceside=true;interface=wifi to your connection URLs passed to Connector.open().
Developer
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: Blackberry data networking (WiFi in particular)

Thank you for you input.

 

But i have testedthe behaviour several times and it is not working.

 

The WiFi coverage (without the data plan) is never true:

 

 

WLANInfo.getWLANState()==WLANInfo.WLAN_STATE_CONNECTED

 This is only true if a data plan SIM card is in the device.

 

I have used the Network Diagnostic tool to confirm the results.

 

Try ti for yourself. You will never have WiFi status OK in that application unless there is a data plan SIM card inside the phone.

 

I would be happy if someone proves me wrong.

 

My application reuses the concept from the Network Diagnostic tool so many have confirmed to be OK.

 

If you check the source, you will see that without the proper WLAN_STATE_CONNECTED, the string is never initialized to:

 

baseURL+";interface=wifi";

 

Is there abug in the 

WLANInfo.getWLANState()  ?

 

WLANInfo.getWLANState() in that case


"Listen carefully, I shall say this only once"
Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Blackberry data networking (WiFi in particular)

don't have the time to test this with you, but you can try this code (i use it in 4.2.1 which has no WLANInfo class):
CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_CARRIER, RadioInfo.WAF_WLAN, true)
----------------------------------------------------------
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: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: Blackberry data networking (WiFi in particular)

I was just doing this in the background Smiley Wink

 

Trying to use the following:

 

 

if((RadioInfo.getActiveWAFs() & RadioInfo.WAF_WLAN) != 0 //&& (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_CARRIER, RadioInfo.WAF_WLAN, false))){ && (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT, RadioInfo.WAF_WLAN, false)))

{ coverageWiFi = true; }

 (the first line is a removal of deprecated flag. API 4.2 reports the same thing for _CARRIER as API 4.6 for _DIRECT)

 

 

Will report as soon as I know more.

 

Thanks for the idea



"Listen carefully, I shall say this only once"
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Blackberry data networking (WiFi in particular)

I use ServiceBooks to detect the presence of WiFi, not the falgs.  This means my code will run in all levels of OS.  For samples and discussion, have a look at these Threads:

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=16757

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=41139

 

Not only can you use WiFi durectly from programs, but also devices with no SIM and in fact, devices with dead Sims (just tested this) can use the WiFi Browser.  Do you want to try this?

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Blackberry data networking (WiFi in particular)

As noted, I don't use those flags, nor I have attempted to determine when they might be set. 

 

The following just how I think it works, I've not had any input from RIM and I'm not really that good on these sorts of things.  So perhaps I'm completely wrong!

 

However my experience with the ServiceBooks leads me to think that WiFi has two states

1) the device can connect using WiFi

2) the device has found "home base" and so will direct traffic over WiFi.

 

For BIS users, I suspect that these two will never happen independently, because I think home base is the RIM supplied Server which is public, so can be found on any WiFi network.  For BES users, the device has to have found the BES via Wifi to get to state 2, which really means that it has be VPNed in, or on the Corporate WiFi.

 

I think the flag you are testing is looking for state 2.

 

If you have not got a SIM, or a SIM with a data plan, you will never get to State 2. 

 

My understanding and experience is that as long as you have state 1, you can use WiFi by coding ";interface=wifi". 

 

I have tested that I can use WiFi in this way on the following devices: 8820, 8320, Bold, Curve 8900. 

Developer
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: Blackberry data networking (WiFi in particular)

[ Edited ]

 

Great info,

 

I have already read your previous posts and they are (as usually) information packed !

 

 

My code (following the example from 'offica' Network Diagnostics tool) uses a two step approach:

 

1)  check the records



for (int i = 0; i < records.length; i++)

{
ServiceRecord myRecord = records[i];
String cid, uid;

if (myRecord.isValid() && !myRecord.isDisabled()) {
cid = myRecord.getCid().toLowerCase();
uid = myRecord.getUid().toLowerCase();

  ...

// WiFi
if (cid.indexOf("wptcp") != -1 && (uid.indexOf("wifi") != -1 || uid.indexOf("wi-fi") != -1)) {
srWiFi = myRecord;
}
...
}


 and 2) See if there is enough coverage

 

if((RadioInfo.getActiveWAFs() & RadioInfo.WAF_WLAN) != 0 
//&& (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_CARRIER, RadioInfo.WAF_WLAN, false))){ // os >= 4.2
&& (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT, RadioInfo.WAF_WLAN, false))){ // os >= 4.5
//if(WLANInfo.getWLANState()==WLANInfo.WLAN_STATE_CONNECTED){ // old way -> true only with data plan
coverageWiFi = true;
}

 

Then i use the User's preference setting and my  coverage flags to see which connection type to build.

 

And it's working !

 

Than you all for participating. 

 

[edit] -> Was in edit mode so I didn't see Peter's post.

Message Edited by myraddin on 10-02-2009 11:28 AM


"Listen carefully, I shall say this only once"
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Blackberry data networking (WiFi in particular)

Sorry for the multiple posts and the spelling and typos in my posts.  I don't seem to have the Edit option on the 'bar' at the top of the posts so can not correct an existing Post.