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

Native Development

Reply
Contributor
lichienmine
Posts: 34
Registered: ‎08-15-2013
My Device: Blackberry 10
My Carrier: XL

Open Browser Within App

anybody can help me, i want to open browser within the app(not in new windows). I can do it for native facebook with invocation , but i do know how to do it for browser ?

Please use plain text.
BlackBerry Development Advisor
sabdelsayed
Posts: 249
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Open Browser Within App

[ Edited ]

Hi lichienmine,

 

For this you can use a WebView and indicate the url in the URL property.

 

Documentation: http://developer.blackberry.com/native/documentation/cascades/ui/webview/

API Doc: http://developer.blackberry.com/native/reference/cascades/bb__cascades__webview.html

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
Developer
maarko
Posts: 119
Registered: ‎07-02-2013
My Device: Q10 v10.2.0.424
My Carrier: {unbranded}

Re: Open Browser Within App

[ Edited ]

yep, webview. and don't forget to put it in scrollview - other way you won't be able to view content the goes beyond screen.

Please use plain text.
Developer
BrajeshSanodiya
Posts: 130
Registered: ‎08-03-2011
My Device: torch, Z10
My Carrier: Vodafone, Airtel

Re: Open Browser Within App

[ Edited ]

Try this:

#include <bps/navigator.h>


QString _url="";
navigator_invoke(url.toStdString().c_str(),0);

-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Please use plain text.
Developer
greenmr
Posts: 865
Registered: ‎03-20-2013
My Device: Red LE Developer Z10
My Carrier: Fido

Re: Open Browser Within App

As others have pointed out you have to use a WebView for this since the BB10 browser doesn't publish a card for invoking. WebView works well overall, but it does have some unfortunate quirks, such as not honouring anchor hashes. See one of my earlier posts for workarounds for several of WebView's limitations.

 


lichienmine wrote:

anybody can help me, i want to open browser within the app(not in new windows). I can do it for native facebook with invocation , but i do know how to do it for browser ?






Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.
Please use plain text.
Developer
greenmr
Posts: 865
Registered: ‎03-20-2013
My Device: Red LE Developer Z10
My Carrier: Fido

Re: Open Browser Within App

Actually, DON'T try this! navigator_invoke() has been deprecated, which means that at any time in the near or distant future the library for this may disappear on BB10 devices and your code will no longer work! In any case, this suggestion will just launch the BB10 Browser to display the URL, which you clearly stated is not what you want.

 

 

Use a WebView as suggested instead.

 


BrajeshSanodiya wrote:

Try this:

#include <bps/navigator.h>


QString _url="";
navigator_invoke(url.toStdString().c_str(),0);






Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.
Please use plain text.