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
Developer
peter_strange
Posts: 19,515
Registered: ‎07-14-2008

Re: Detecting MDS access via WiFi

[ Edited ]

Please note my correction.  my test (b) involved disabling wireless, not WiFi.

 

This is just further evidence that what I see is different to you. 

 

Can I suggest that you take the httpDemo, hard code ";deviceside=false" and try that on your device using the same tests as above.  I will try that on some BES connected OS 6.0 devices here at some stage, but it will not be till tomorrow at the earliest. 

Please use plain text.
Administrator
MSohm
Posts: 14,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: Detecting MDS access via WiFi

There are a couple of other factors that you need to consider here.

 

Is the BES on the WiFi network the BlackBerry Smartphone is connected to?

Does the BlackBerry Smartphone have a BES data plan?

 

There are two ways you can connect to a BlackBerry Enterprise Server over WiFi and both happen automatically.

 

WiFi directly to the BES

 

This one is only possible if the BES is directly accessible over the WiFi network you are connecting to.  Typically this will only be available when you are connected to your corporate network.  

 

WiFi to BlackBerry Infrastructure then to BES

 

This options is available on any WiFi network with access to the Internet.  A connection over WiFi to the BlackBerry Infrastructure is what triggers the WiFi icon change indicating BlackBerry service.  

 

 

The important thing to note is that the second route requires a BlackBerry data plan.  If the device isn't associated with one the BlackBerry Infrastructure will not allow it to connect.  The first option (direct to BES) does not.

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.
Contributor
SergeyAYakovlev
Posts: 10
Registered: ‎09-21-2011

Re: Detecting MDS access via WiFi

MSohm,

Yes. BlackBerry has BES DataPlan.
I mean public Wi-Fi (not corporate). So: BlackBerry > Wi-Fi hotspot > Internet > BlackBerry Infrastructure > BES
Please use plain text.
Administrator
MSohm
Posts: 14,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: Detecting MDS access via WiFi

Are you just turning the cellular radio off when testing (not removing sim card, etc...)?

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.
Contributor
SergeyAYakovlev
Posts: 10
Registered: ‎09-21-2011

Re: Detecting MDS access via WiFi

yep! and data services work without any problem: there's the "BlackBerry" icon the right corner of the Wi-Fi icon

 

and I can use corporate (BES) mail, use BlackBerry Browser to open internal (corporate) web resources etc. 

 

and, like I wrote before, I found the Bloomberg app, which works & shows that MDS is OK. 

Please use plain text.
Administrator
MSohm
Posts: 14,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: Detecting MDS access via WiFi

What exception do you get when you try?  What are it's .toString details?  Does it get thrown right away or after 2 minutes?

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.
Contributor
SergeyAYakovlev
Posts: 10
Registered: ‎09-21-2011

Re: Detecting MDS access via WiFi

peter_strangeMSohm, gyus! SORRY! I need to take a timeout. I really confused now.. and I asked our app's developer company to manage the situation... but I found, that in Wi-Fi mode, app really shows that it uses deviceside=true... (*SHOCKED*).

 

They use this code to ask device about available service books &  to select "automaticaly" the appropriate one:


private HttpsConnection createConnection(String url, String connectionMethod) throws HttpException{
//prepare URL
url = URLUTF8Encoder.encodeURL(url);
url = networkUtils.getAutoURL(url);
//prepare connection
HttpsConnection c = null;

try{
Utils.saveLogConnection(url);
c = (HttpsConnection) Connector.open(url);

c.setRequestMethod(connectionMethod);
}
catch(ClassCastException e){
throw new HttpException(HttpException.HTTP_DEFAULT_ERROR, "Not supported connection type.");
}
catch(Exception ex){
throw new HttpException(HttpException.HTTP_DEFAULT_ERROR, ex.toString());
}

return c;
}
.......................
public String getAutoURL(String originalUrl) {

// first try wifi
if (coverageWiFi && Settings.getSettings().isUseWIFI() == true) {
System.out.println("WiFi (HTTP)");
return getWiFiURL(originalUrl);
}
// second try BES
if (sbMDS != null && coverageMDS) {
System.out.println("MDS (HTTP)");
return getMDSURL(originalUrl);
}
// third try Unite (such exotic :smileyhappy:
if (sbUnite != null && coverageUnite) {
System.out.println("Unite (HTTP)");
return getUniteURL(originalUrl);
} else
// fourth try BIS-B
if (sbBIS != null && coverageBIS) {
System.out.println("BIS-B (HTTP)");
return getBISURL(originalUrl);
}
// fifth try direct TCP
if (coverageTCP) {
System.out.println("Direct TCP (HTTP)");
return getTCPURL(originalUrl);
}
// at last try to use WAP2
if (sbWAP2 != null && coverageWAP2) {
System.out.println("WAP2 (HTTP)");
return getWAP2URL(originalUrl);
}
// no coverage
return originalUrl;
}

... so finally I have this result: 

 

1) When the only Wi-Fi is active (and the smartphone is successfully connected to BlackBerry Infrastructure) - the app doesn't work: 


New Connection:
https://InternalServerURL/?ident=Notices&viewname=(ViewName);deviceside=true
---------------------------------
Error:
java.io.IOException: Radio is off
More info: com.intertrust.cm.bb.exceptions.HttpException: java.io.IOException: Radio is off


2) When the only Mobile Network (EDGE/3G) is active - the app works:


New Connection:

https://InternalServerURL/?ident=Notices&viewname=(ViewName);deviceside=false;ConnectionUID=S10613362



So, I asked them (developer company) to make a new app build with the deviceside=false like "hardcode" parameter - and I'll try it after that. If it works (I hope we have a chance :-) ) - we'll probably think about "Why the used code doesn't work right in the Wi-Fi only mode"  or just change this approach to "hardcode" settings.

 

Please, sorry for this confuse once more. I'll tell you the result. 

 

- Sergey

 


..............
 

Please use plain text.
Contributor
SergeyAYakovlev
Posts: 10
Registered: ‎09-21-2011

Re: Detecting MDS access via WiFi

Yep. Sorry. I'm really sorry, guys .. There were no causes to disturbed you. I put ashes on my head. This code really works incorrect (if someone has any ideas - I would appreciate that).. but the devicedise=false works like it should..
Thanks.
- Sergey

Please use plain text.