01-06-2011 08:03 PM
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
01-06-2011 08:20 PM
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
01-06-2011 08:50 PM
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.)
01-19-2011 01:41 AM
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.
01-19-2011 09:01 AM
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
01-19-2011 09:24 AM
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?
01-19-2011 10:26 AM
thx for the quick reply
the sdk and simulator i'm using are as given on the blackberry getting started page
i was just trying to load any url, afterwards trying 'http://www.google.com', but nothing works
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):
01-19-2011 10:37 AM
(Images only appear after a moderator approves them, so the rest of us won't be able to see them for a while.)
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...)
01-19-2011 11:23 AM
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:
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