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
Developer
johnbibs
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom
Accepted Solution

Alternate-Entry point in widget

Hi,

 

Is it also possible to recreate the behavior of an alternate-entry point in widgets? I'm thinking of creating a widget that has push listener which will run on device startup to listen for push messages.

 

Thanks!

Please use plain text.
Developer
jtyberg
Posts: 124
Registered: ‎09-06-2010
My Device: Not Specified

Re: Alternate-Entry point in widget

[ Edited ]

I've never created a push application, but it it should work the same as in Java app.  In fact, WebWorks apps ARE Java apps.

 

They behave the same way with regard to background/foreground.  The WebWorks API has Push APIs (blackberry.push) and application APIs (blackberry.app) to handle background/foreground events.  I've got the foreground/background events working in my app.

 

If you can't do what you need from the API, you can always create a JavaScript Extension and go native Java.

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Alternate-Entry point in widget

Take a look at the <content> element in the config.xml file.  You can specify an html file to load and run on startup... 

 

http://docs.blackberry.com/en/developers/deliverables/20977/RIM_background_element_1265316_11.jsp

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Developer
johnbibs
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Alternate-Entry point in widget

 


jtyberg wrote:

I've never created a push application, but it it should work the same as in Java app.  In fact, WebWorks apps ARE Java apps.

 

They behave the same way with regard to background/foreground.  The WebWorks API has Push APIs (blackberry.push) and application APIs (blackberry.app) to handle background/foreground events.  I've got the foreground/background events working in my app.

 

If you can't do what you need from the API, you can always create a JavaScript Extension and go native Java.


 

hi jtyberg,

 

Thanks for the reply. yeah i'm aware of that. :smileyhappy: Basically i'm asking about the alternate-entry point so i'll understand how a webworks app will behave if it will run on startup. 

 

:smileywink:

Cheers!

Please use plain text.
Developer
johnbibs
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Alternate-Entry point in widget

Hi tneil,

 

that's what i'm looking for. One follow up question though, so if i'm going to set specific html that will be loaded on startup, then it is possible that a screen will appear on startup(maybe a blank screen)  then just request it to run on background? is that the appropriate approach? 

 

Thanks!

 

 

Please use plain text.
Developer
kemasD
Posts: 37
Registered: ‎01-18-2011
My Device: Huron 8800
My Carrier: IM3

Re: Alternate-Entry point in widget

[ Edited ]
<content src="index.html">
<rim:background src="backgroundProcess.html"/>
</content>

You can do this in your config.xml. This option can be visually choosen if you use BlackBerry Web Plugin for Eclipse.

 

the <rim:background src="" /> tells the widget to "run" the destinated url in background at device startup / installation.

Please use plain text.
Developer
johnbibs
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Alternate-Entry point in widget

 


kemasD wrote:
<content src="index.html">
<rim:background src="backgroundProcess.html"/>
</content>

You can do this in your config.xml. This option can be visually choosen if you use BlackBerry Web Plugin for Eclipse.

 

the <rim:background src="" /> told the widget to "run" the destinated url in background.


 

Hi kemasD,

 

yup. That's what tneil mentioned. Thanks for the input though. :smileyhappy:

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Alternate-Entry point in widget

[ Edited ]

The HTML file you specify to run on startup <rim:background> will run in the background on startup.. it will not come to the foreground.

 

When a user then clicks on your Home Screen icon to enter your application, it will be brought to the foreground.

 

Here is where you need to make a decision.... The entrypoint that will be used when someone clicks on your home screen icon is the "src" attribute in the <content> element.  You can make this the same HTML file as your run on startup page or a different one.  It is up to you.  If it is the same as the run on startup page <rim:background> your application will simply be brought to the foreground.

 

If you choose a different page for your "src" in the <content> element that new page will be loaded when the user clicks on your home screen icon.

 

There is only ever one page active at any time inside your WebWorks application..

 

Clear as mud?? :smileyhappy:

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Developer
johnbibs
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Alternate-Entry point in widget

O yeah! That's what I'm looking for.

Thanks tneil!
Please use plain text.
Regular Contributor
genvej
Posts: 58
Registered: ‎01-19-2011
My Device: 9800
My Carrier: vodafone

Re: Alternate-Entry point in widget

hmmm.... that is not my experience Tim. My alternate entry point has an endless loop which keeps running regardless if im bringing the "main" entry point to focus. I do have a big problem though. Because when i exit my application and its main entry it closes my alternate entry point as well... Can I do something to prevent this?

Please use plain text.