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
New Developer
Posts: 2
Registered: ‎11-23-2009
My Device: Not Specified

Custom Widgets Extensions

Hello,

 

I am developing Widget application and I would like to expand JavaScript API with my own Java extensions. I was unable to find more information about this. Like some samples and ways of deploying Widgets with my own extenstions.

 

Can someone point me in right direction or give some sample code?

 

Thanks.

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Custom Widgets Extensions

Hi There,

 

We currently don't have a tutorial up on the web on how to do this.  It isn't fully supported yet, but we did show a way to make it work with the existing SDK at the BlackBerry Developer Conference.  

 

It is a bit of a hack, but it works Smiley Happy

 

I'll talk to the team and see if we can get the tutorial posted online.

 

Cheers,

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Custom Widgets Extensions

A good place to start looking is the Scriptable class:

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/script/Scriptable.html

 

Also the WidgetExtension Interface:

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/web/WidgetExtension.html

 

Putting a widget extension together for inclusion in a BlackBerry widget uses these different pieces... We will try and get a tutorial up on how to use them to achieve an extension soon.

 

Essentially you can create your Scriptable objects and functions, and then create a class that implements the WidgetExtension interface so that it plugs into the widget framework.

 

The trick is then getting it to compile into your BlackBerry Widget.. this is where the tutorial comes in handy Smiley Happy

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Developer
Posts: 2
Registered: ‎01-19-2010
My Device: Curve 8900
My Carrier: Rogers

Re: Custom Widgets Extensions

Hi,

I'm currently looking to do the same thing, more specifically using the bluetooth api inside a widget.  I have not been able to find any information on creating the custom widget extensions, except that I'm suppose to use the net.rim.device.api.script and net.rim.device.api.web packages. 

 

Has the tutorial been created for creating custom widget extensions, and if so where might I be able to find it?

 

Thanks!

 

 

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Custom Widgets Extensions

There is another thread on the topic here:

http://supportforums.blackberry.com/t5/Web-Development/Adding-custom-menu-items-using-the-Widget-API...

 

I've seen Adam's first draft and provided comments and suggestions back .  We are going through the second review process right now.

 

The tutorial shows how to write extensions that will work with the existing Beta software.  There will be a more elegant process moving forward, but the tutorial will get you started.  You will be able to reuse all your code in the final solution, you will just package it slightly different.

 

We are trying to push this tutorial through the process and get it up as quickly as we can. 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Custom Widgets Extensions

The lab outlining how to create a JavaScript extension that can wrap any of the existing Java APIs can now be found here:

http://na.blackberry.com/eng/developers/devbetasoftware/Lab_Widget_Extension.zip 

 

Cheers,

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Developer
Posts: 2
Registered: ‎01-19-2010
My Device: Curve 8900
My Carrier: Rogers

Re: Custom Widgets Extensions

Thanks for following up on this Neil.  I will definitely look into it sometime over the next week.