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

Web and WebWorks Development

Reply
Highlighted
Visitor
Posts: 1
Registered: ‎08-30-2013
My Device: Z10
My Carrier: T-Mobile DE

"rim:background" not working for BB10...?

[ Edited ]

Hi,

 

I am trying to implement background activity into my app. I added this code to my config.xml:

 

    <content src="index.html">
        <rim:background src="bg_execution.html" runOnStartup="true" />        
    </content>

 to test background activity, I added this code to bg_execution.html:

 

onload="localStorage.setItem('i', 20);"

Theres a button in my app which reads and alerts this item from the localstorage, but it always shows up NULL --> background task is not working!

 

On http://developer.blackberry.com/bbos/html5/documentation/rim_background_element_1265316_11.html they say: "If you port your app to BlackBerry 10, you will need to use the <param> lement instead.". But I can't find any further information to this in the api reference.

 

What did I wrong? Is there another way to do this fpr BB10?

 

Thanks a lot!

Mike

 

Developer
Posts: 164
Registered: ‎11-27-2012
My Device: Z10 LE,Dev Alpha C
My Carrier: China Mobile

Re: "rim:background" not working for BB10...?

<rimSmiley Tongueermissions>
<rimSmiley Tongueermit>run_when_backgrounded</rimSmiley Tongueermit>
</rimSmiley Tongueermissions>

maybe this is what you are looking for?


and try this example:

https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/Injection

maybe it helps.
BlackBerry Cascades / WebWorks developer, Vendor name: anpho
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: "rim:background" not working for BB10...?

The rim:background element is not supported on BB10, only BBOS.

On BlackBerry 10, we've recently introduced the concept of headless applications to the native SDK:
http://devblog.blackberry.com/2013/08/rise-of-the-headless-apps/

While our development teams are working to bring this to WebWorks as well, it is not available just yet. Currently the priority for WebWorks is the transition to our Cordova-based implementation.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.