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
BlackBerry Development Advisor
Posts: 15,727
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Invoking Blackberry Browser

Quote from the previous forum:

 


Guest: Tim
Invoking Blackberry Browser
Posted: Jul 18, 2008 7:58 PM
 
Hi,

I am invoking the blackberry browser in the middle of my app. Is there a way to gain control over the application from that point on (for example, what shows up on the menu, etc.) or is it all the browser from that point on?

Thanks,

Tim

 


Guest
Re: Invoking Blackberry Browser
Posted: Jul 21, 2008 11:18 AM
 
You have more control if you are using browser field item. I don't think that you have much control if you are using the BB full browser. You are basically just invoking a third party application from yours.

 


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
Retired
Posts: 86
Registered: ‎07-11-2008
My Device: Not Specified

Re: Invoking Blackberry Browser

When launching the browser (either via MIDlet.platformRequest() or Browser.getDefaultSession().displayPage()), the original responder is correct: you have turned over control to another application, and cannot alter the contents of that application's menu, with the exception of adding in an ApplicationMenuItem via the ApplicationMenuItemRepository.

Brian Zubert
Technical Partnership Manager
Research In Motion
New Developer
Posts: 3
Registered: ‎07-21-2008
My Device: Not Specified

Re: Invoking Blackberry Browser

Thank you for the reply.  I am trying to use the browser field now; is it possible to customize the menu for the browser field and also change the scroll over links feature into a free moving cursor?

 

Thanks again. 

BlackBerry Development Advisor
Posts: 15,727
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Invoking Blackberry Browser

You can add other browser menu options by changing the RenderingOptions used by the browser field.  Have a look at the RenderingOptions class for more information.

 

A browser field opens in Column View.  A user can change this by selecting Page View from the menu on BlackBerry models that support this view.  This provides a cursor a user can scroll over the page.

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
Retired
Posts: 18
Registered: ‎07-14-2008
My Device: Not Specified

Re: Invoking Blackberry Browser

You could also customize the menu of the browser field by implementing your own MainScreen class and overriding the makeMenu method.  This gives you full control over the menu displayed.

 

-Jeremy

Jeremy Weber
Sr Application Development Consultant
Research In Motion
New Developer
Posts: 3
Registered: ‎07-21-2008
My Device: Not Specified

Re: Invoking Blackberry Browser

Hi Jeremy,

 

If I made my own menu, wouldn't the browser field menu end up overriding my menu once it is invoked?

 

Thanks. 

BlackBerry Development Advisor
Posts: 15,727
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Invoking Blackberry Browser

No, you can add additional items to the menu and have them both appear.  You'd just add your own menu items within the makeMenu method.
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
New Developer
Posts: 5
Registered: ‎09-11-2008
My Device: Not Specified

Re: Invoking Blackberry Browser

1. Can I launch the net.rim.blackberry.api.browser via the net.rim.blackberry.api.browser.BrowserSession.displayPage() method? (http://www.blackberry.com/developers/docs/4.6.0api/net/rim/blackberry/api/browser/BrowserSession.htm...)

 

2. If so, how can I configure things so that when the user presses the back button (or the BB equivalent), the launching application is invoked? I see that net.rim.blackberry.api.browser.BrowserSession.displayPage() takes a referrer string. It looks like this could be a URL, and that URL could be an application configured url. 

 

3. So, how do I configure my application to launch via a specific URL?

 

To summarize, I simply want to launch the browser from my application, and provide an easy BB idiomatic way for the user to return to my application when they are finished in the browser.

 

APPLICATION --> launches BROWSER --> user is done w/ browser, presses BACK button --> launches APPLICATION

 

-Todd 

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Invoking Blackberry Browser

You RIM guys are referring to a "Browser Field" - is this a class that I should be able to find in the API reference? Can you be a little more specific?
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Invoking Blackberry Browser

RexDoug - I suggest you review the Chapter in the JDE called "Using the BlackBerry Browser" especially the section called "Display content in a BlackBerry Browser field" to explain what 'classes' you need to use for a Browser Field.

 

TGreenwood

1. Yes

2. As far as I am aware, you can't.  As noted in previous replies to this post, the Browser is a separate application, effectively what you are doing is requesting that the Browser come to the foreground and display the page you have asked for.  From there the use can do whatever they want.  However, in most cases the Browser will just appears as a window over the top of your application.  So when the user Escapes from the Browser they will end up displaying your application as if the Browser had been a window in your application.  If you really want the Browser display to be specific to your Application, you need a Browser Field.  See above.

3. See the Chapter in the JDE called "Using the BlackBerry Browser", section "Display content in the BlackBerry Browser".

It is very easy, give it a go.