Thank you for visiting the BlackBerry Support Community Forums.
- Kevin Michaluk, Founder, CrackBerry.com
09-29-2008 01:42 AM
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?
09-29-2008 07:46 AM
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
09-29-2008 08:16 AM
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 );
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...
09-29-2008 08:26 AM
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).