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
New Developer
daljit97
Posts: 53
Registered: ‎09-05-2013
My Device: Z10

WebView in a headless app

Hello, 

I am working with a headless and I want to use the WebView or WebPage class in it. When I use it I get the following error "undefined reference to `bb::cascades::WebPage::WebPage(QObject*)". I have included <bb/cascades/WebPage> class, can anyone help to resolve this issue. 

Retired
erahnenfuehrer
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10

Re: WebView in a headless app

Headless apps do not have a UI portion.  If you need to display something to a user via a webview, you need to have a separate app that your headless app communicates with.  For more information on Headless apps see:

 

https://developer.blackberry.com/native/documentation/cascades/device_platform/headless_apps/index.h...

 

And there are sample apps that show Inter-Process communication between UI and headless apps:

 

https://github.com/blackberry/Cascades-Samples/tree/master/xandos

 

https://github.com/blackberry/Cascades-Samples/tree/master/xandosdroid

 

New Developer
daljit97
Posts: 53
Registered: ‎09-05-2013
My Device: Z10

Re: WebView in a headless app

Yes I know that headless apps can't have a UI, but the using the WebPage should be usable, right? The documentation says "A webpage that can be used when the app needs to interact with web content but not display it." 

BlackBerry Development Advisor
shaque
Posts: 237
Registered: ‎07-14-2008
My Device: Not Specified

Re: WebView in a headless app

Did you add cascades10 in your .pro file of the headless project. You can try adding that but I highly doubt it will work as you are not supposed to add cascades10 library to your headless project. The bb/cascades package should not be usable from headless.
New Developer
daljit97
Posts: 53
Registered: ‎09-05-2013
My Device: Z10

Re: WebView in a headless app

I just tried, but now I have his error "Please use bb::cascades::Application" to instantiate.

BlackBerry Development Advisor
shaque
Posts: 237
Registered: ‎07-14-2008
My Device: Not Specified

Re: WebView in a headless app

That sounds right. Now it wants you to use bb::cascades::application instead of bb::application which would lead to another error. Please do not use any classes from bb/cascades package.
New Developer
daljit97
Posts: 53
Registered: ‎09-05-2013
My Device: Z10

Re: WebView in a headless app


shaque wrote:
That sounds right. Now it wants you to use bb::cascades::application instead of bb::application which would lead to another error. Please do not use any classes from bb/cascades package.

This mean it is not possible to use any bb::cascades class in a headless app? So there is no solution?

BlackBerry Development Advisor
shaque
Posts: 237
Registered: ‎07-14-2008
My Device: Not Specified

Re: WebView in a headless app

Not at the moment. Can you share some details on your use case here or why you need to use this class in your headless project. I will raise it internally..

Thanks.

Shadid
New Developer
daljit97
Posts: 53
Registered: ‎09-05-2013
My Device: Z10

Re: WebView in a headless app

[ Edited ]

shaque wrote:
Not at the moment. Can you share some details on your use case here or why you need to use this class in your headless project. I will raise it internally..

Thanks.

Shadid

My goal is to provide notifications parsed from a web service injecting javascript, when application is not running in foreground. 

Developer
billbsb
Posts: 144
Registered: ‎03-25-2011
My Device: Playbook, Z10 L.E.

Re: WebView in a headless app

Hi there!
I'm also trying something similar. Here's my post:
http://supportforums.blackberry.com/t5/Native-Development/QScriptEngine-on-Headless-app/m-p/2840956
Cheers!