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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

Posts: 61
Registered: ‎09-29-2008
My Device: Not Specified

BrowserSession BB JDE


We are trying to use the browser session Class form JDE API 4.6.0 from the app, to form an internal http request with basic authentication's and to embed the browser screen into app GUI.


Can we form a basic authentications request with this class and to open the corresponding URL?


We tried to do the same with a HttpConnection, get authorization and then to use Browser.getDefaultSession()   over already authorized connection), but this approach doesn't work.


Can we control the BrowserSession page (ShowBrowser or DisplayPage method) inside in the form or canvas?


Anybody has some luck with a similar task?



Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: BrowserSession BB JDE

You might want to take this over to the browse forum but I can say that AFAIK right now, our browser works

as well as the BB browser on https and with form submissions. I'm not exactly sure what you are trying

to do but if you could post more details I'd be curious. There are a few places where BB browser doesn't

appera to work, at least some versions. At least one site seems to have js designed to prevent

automated posting but I haven't been able to get beyond that yet.


I'm only using stuff available on 4.0.2 but certainly back then you couldn't  interact much with the existing browser,

and even with your own you end up in many cases wanting to subclass RIM private things and this is not possible.

So, we duplicated a lot of code to get a full feature browser but still can't get some of the deetails modified. For example,

I'm not sure there is anyway to use their html parse code to extract image links without rendering the page and monitoring



Posts: 61
Registered: ‎09-29-2008
My Device: Not Specified

Re: BrowserSession BB JDE

1) I am trying to form the basic authorization request for the browser from the app. For the regular http connection it will be formed as :


 hc = (HttpConnection) Connector.open( IP );
  hh.setProperty("Connection", "close");
  userPass = username+":"+password;
  userPass = Base64.encode(userPass.getBytes());
  hc.setProperty("Authorization", "Basic " + userPass);
 respCode = hc.getResponseCode();
 inputStream = hc.openInputStream();
 respMsg = hc.getResponseMessage();


but I don't see how i can set these propertys and responseif I want to work with  BrowserSession, after calling

myBrowserSession = Browser.getDefaultSession(). Or may be I have to use another class?


2) when I call BrowserSession.ShowBrowser(); or BrowserSession.DisplayPage(), it just open another full-size page on the screen. Can put this page inside in a cistom Form or Canvas; or can I switch between this page and a Form? I don't see any methods, but may be i am not looking at the right place...

Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: BrowserSession BB JDE

AFAIK on 4.0-4.3 anyway there is no way to pass a connection just a url for  a get request.

Browserfield works the same way and there isn't a lot of support you need to write to get a full functioning

browser but you can't share bookmarks etc ( although I think you could probably just supply

the right hash code to perssitent storage but this is secret).