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

Adobe AIR Development

Reply
New Developer
chrisnicholls
Posts: 18
Registered: ‎12-29-2010
My Device: Torch 9800
My Carrier: Telus

Do we know how to launch the web browser?

I'm wondering if there is any way to launch the web browser and load a specific url. Has there been any info on it?


I don't want to integrate qnx.media.QNXStageWebView

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Do we know how to launch the web browser?

hey chris,

 

in theory the following code should open up a given url in a browser. however because we cant test it out at this point its going to remain just a theory until we get a working browser in the simulator:

 

 

var urlRequest:URLRequest = new URLRequest("http://www.google.com");
navigateToURL(urlRequest);

 

In normal AIR apps it opens up a new browser and navigates to the page no problem. but depending on how the environment on the playbook is set up it may be different. and i also agree i dislike using the QNXStageWebView in any of my apps just yet.

 

 

p.s. nice avatar :smileyhappy:

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Do we know how to launch the web browser?

There are actually times when it would be more appropriate to use QNXStageWebView as an embedded HTML engine, though I doubt this is a novel idea to many.

 

If you're trying to send the user to a particular URL, but either that page may contain links to other pages or it's just a regular web site and you want to let the user navigate to arbitrary new locations, then of course launching the whole browser (however we'll do that) is suitable.

 

If you have some "canned" content at a "specific URL", however, like maybe some documentation pages related to your app, then embedded the HTML engine might be more appropriate.  You wouldn't necessarily want to have all the baggage of favourites, external links, the user typing a new address into a location field, or possibly even a Back button.

 

(And of course one place you could put this sort of canned content would be right in the app package itself.  You may not want to launch the whole browser to view that sort of thing.)


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
New Developer
ericcwhung
Posts: 22
Registered: ‎03-24-2010
My Device: Storm
My Carrier: 3

Re: Do we know how to launch the web browser?

Hi,

 

I have tired the code, not working in Tablet SDK 0.9.2 (beta 3).

 

navigateToURL(urlRequest, "_blank");

 

Any workaround ?

 

Thanks

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Do we know how to launch the web browser?

hey eric,

 

that bit of code will not work in the simulator as of right now because there is no browser available within the simulator. when the simulator (or actual device) does provide us with a browser, that code should theoretically work. at this point the only way of viewing a webpage like a browser would, using the QNXStageWebView class is going to be your best bet.

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Developer
pyth
Posts: 503
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: Do we know how to launch the web browser?

hello everyone,

 

i'm also new to all this (installed everything yesterday, and now listening to the screencasts). i'm also wondering about a method to load a webpage in the playbook simulator. though i tried using the QNXStageWebView, i'm unfortunately only getting a white screen at first, then (after a while) the message 'could not be loaded etc. ' and a button to 'retry'. the code i used was from here: http://www.petefreitag.com/item/770.cfm

 

any ideas?

-----------------------------------------------------------------------
I'm a bird from outer space. But I'm not flappy o.o
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Do we know how to launch the web browser?

I assume you're either using that code with the previous SDK, or have made the required modifications for it to work with the Beta 3 SDK...

 

What URL are you trying to load?  Any reason to think the problem isn't related to the network or the data you're loading actually being unavailable?


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
pyth
Posts: 503
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: Do we know how to launch the web browser?

thx for the quick reply

 

the sdk and simulator i'm using are as given on the blackberry getting started page

http://us.blackberry.com/developers/tablet/adobe.jsp?IID=DEVTABOS01042011

 

i was just trying to load any url, afterwards trying 'http://www.google.com', but nothing works :smileysad:

 

i just noticed, letting it run for a few minutes returns me this in the console: Error #2044: Unhandled error:. text=Couldn't connect to server

 

 

a few screenshots here (with the src from the previous post):

Unbenannt1.pngUnbenannt2.pngUnbenannt3.png

-----------------------------------------------------------------------
I'm a bird from outer space. But I'm not flappy o.o
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Do we know how to launch the web browser?

(Images only appear after a moderator approves them, so the rest of us won't be able to see them for a while.)

 

In the meantime, did you you change the code to work with the new QNXStageWebView?  The original code you pointed us to was for an earlier undocumented version, and doesn't work without a few minor fixes like changing enableJavascript to enableJavaScript.

 

At this point, you should probably be investigating whether you have some network problems that would affect the simulator.  When reporting problems it's often a good idea to let us know what platform you are on.  Also check whether you are using Bridged or NAT networking in your VMware settings for the simulator.  (Some of these questions may be answered by your screenshots, when they appear...)


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
pyth
Posts: 503
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: Do we know how to launch the web browser?

yes, i did the changes. elsewise Flash Builder was always giving errors, not compiling anything at all...

 

there was btw one more interesting thing. i'm not sure, if blackberry is using a static (fixed) website or not, but trying to run the rssreader example from their getting-started-page, i was actually able to get the rss-feed. meaning that i was able to access an url, though only the feed for now.

 

and the things i'm using are:

windows 7

BlackBerry® Tablet OS SDK Beta3 for Adobe® AIR®

BlackBerry PlayBook Simulator Beta2 for windows

Flash Builder to create Actionscript Mobile Applications

 

thx again for your effort

-----------------------------------------------------------------------
I'm a bird from outer space. But I'm not flappy o.o
Please use plain text.