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 Contributor
soapmctavish
Posts: 9
Registered: ‎07-17-2012
My Carrier: Tata Docomo
Accepted Solution

BrowserSession issue in OS 5

Hi,

 

In my app, I need to open some url in BB browser. I'm using BrowserSession like this:

 

BrowserSession browserSession = Browser.getDefaultSession();

browserSession.displayPage("http://www.google.com");

browserSession.showBrowser();

 

Under wi-fi connection, this code runs as expected in Blackberry Torch (OS 6), but fails under Blackberry Bold (OS 5). In latter case the browser opens but fails to connect and display error dialogue.

 

Is there something that I'm missing? :catfrustrated:

Please use plain text.
Developer
peter_strange
Posts: 19,515
Registered: ‎07-14-2008

Re: BrowserSession issue in OS 5

In effect, your code is opening the default Browser and entering the URL.  So if you do that on the device, does it also fail?

 

In OS 5.0 there are in effect a number of different "Browsers", so you might need to be be sure which Browser you actualy open.  In fact the major differece between these is the connection path the Browser uses. 

Please use plain text.
New Contributor
soapmctavish
Posts: 9
Registered: ‎07-17-2012
My Carrier: Tata Docomo

Re: BrowserSession issue in OS 5

@peter_strange,

 

I have tested it in actual Bold device, which has no SIM in it and is only connected to Wi-Fi. It failed to connect and displayed error dialogue saying connection wasn't available. However I'm able to open the link (as well as any other valid link) by manually entering the link in Blackberry default browser app.

 

I want to open the link with default Blackberry browser. How can I specify that?

 

Thanks 

Please use plain text.
Developer
peter_strange
Posts: 19,515
Registered: ‎07-14-2008

Re: BrowserSession issue in OS 5

Try the following:

 

From the Home Screen

Choose options(spanner icon)

then Advanced Options

then Browser

 

What is the default Browser configuration?

 

Change this to the Hotspot Browser and try again.

 

That said, the test you are doing is not really representative.  If you want to test your code you wild be better testing in a real working Blackberry would you not?

Please use plain text.
New Contributor
soapmctavish
Posts: 9
Registered: ‎07-17-2012
My Carrier: Tata Docomo

Re: BrowserSession issue in OS 5

Thanks peter_strange. I just set the browser config to hotspot browser and it's working!!

Sorry for late reply... got busy with some work. :smileyhappy:
Please use plain text.