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
Posts: 4
Registered: ‎11-07-2011
My Device: Torch
My Carrier: Wut

Browser Object

[ Edited ]

 Hi everyone,

I'm trying to display a simple webpage, but all the time i'm getting an 120000 timeout..
Probably because i'm doing something wrong..

Also I will be trying to navigate to the project files located in [Projectname] > src > www > index.html

But on the internet there is nothing found about this or any simple tutorial about this..

 

The code I'm using:

BrowserFieldConfig _config = new BrowserFieldConfig();
BrowserField _bf = new BrowserField(_config);
MainScreen _screen = new MainScreen();
_bf.requestContent("http://www.google.com/");
_screen.add(_bf);
pushScreen(_screen);

 
Anyone who could help me with this??

The navigation is to a pre-defined webpage, so there has not to be an addressbar to be shown.

Yours Sincerley,
Lars

Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Browser Object

Hi Lars,

 

Is your MDS on?

 

E.

Developer
Posts: 179
Registered: ‎06-15-2011
My Device: Storm 9550
My Carrier: Vodaphone

Re: Browser Object

Open the default browser of device and try same url.

Highlighted
New Contributor
Posts: 4
Registered: ‎11-07-2011
My Device: Torch
My Carrier: Wut

Re: Browser Object

[ Edited ]

maadani
Hmm, what's an MDS?

 


The url works, but i just dont want the address bar to be shown..

It works with the following code.. but it still displays the addressbar..

 

BrowserSession browserSession = Browser.getDefaultSession();
browserSession.displayPage("http://www.google.com/");
browserSession.showBrowser();

 

Developer
Posts: 179
Registered: ‎06-15-2011
My Device: Storm 9550
My Carrier: Vodaphone

Re: Browser Object

I use the followinf code: inside MainScreen.

 

BrowserFieldConfig  helpConfig = new BrowserFieldConfig();

helpConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);

helpField = new BrowserField(helpConfig);
 helpField.requestContent("local:///abc.html");
VerticalFieldManager helpVFM = new VerticalFieldManager(VERTICAL_SCROLL);
helpVFM.add(helpField);
 add(helpVFM);

New Contributor
Posts: 4
Registered: ‎11-07-2011
My Device: Torch
My Carrier: Wut

Re: Browser Object

[ Edited ]

Aaah, that helped indeed.

However, this browsing type is not functional when using an external website i.e. google.com.
When using the local PhoneCap files, it does load, but the JS functionalities are not responsive..

Any thoughts?