0
Posted December 11, 2012 by Rapid Yvonne in Developers
 
 

BlackBerry 10 WebWorks SDK Gold released

BlackBerry10 WebWorks
BlackBerry10 WebWorks

The gold release of the BlackBerry 10 WebWorks SDK is now available to download.

There is now a full house of cards that you can directly invoke from webworks. From the blackberry.invoke.card namespace, you can leverage the following new cards on top of the camera and file picker cards we already delivered: calendar picker, calendar composer, email composer, media player, contact picker, and ICS viewer card.

RIM have also provided the means to leverage the built in invocation selection UI. If you choose to do your own invocation target queries and provide the user with the ability to select the target, you can use the API to present native look and feel selection UI.

 

Wallpaper: an interior decoration technique that smartphone users love is setting the wallpaper of their device. Allow the user to set the wallpaper from your BlackBerry WebWorks app:

blackberry.system.setWallpaper(pathToImage);

You can now also specify custom contexts in your applications that can be used as a target type for invocation request, and to put custom actions into the context menu.

<div align="left" data-webworks-context="myContext">>

   <h4>Local image link: with customContext</h4>
   <a href="http://www.blackberry.com">
      <img src="../img/secretdeviceimage.jpg" width="150" height="350"/>
   </a>

</div>

If the user triggers an invocation – say, as a long-press on any element within the div in the code example above – the system will pass the “myContext” custom context in the invocation request rather than an image context.

In addition, you will often want the ability to know when your context has been the target of a user-triggered invocation, and do something before the system completes the invocation. In the example above, you might want to add to the invocation request additional relevant information for the “super secret device”. All you need to do is assign a function to the blackberry.invoke.interrupter property. This function will be given the invocation request object, and you can return a modified version of the object that will actually be sent on in the invocation request. You may also just want to allow the user to confirm they wish to take this action.

blackberry.invoke.interrupter = function (request) {          
	if(confirm("System would like to invoke: " + request + 
                            " would you like to continue?")) {
              return request;
        } else {
              alert("User canceled invocation");
        }
};

One of the key user experience items for BlackBerry 10 is the concept of Active Frames. When your application is no longer in the foreground but still running, it gets a placeholder window that by default displays a snapshot of the application when the user put it into the background. With this API, you can customize what is displayed. You can set a different image, as well as specify custom text that will be overlaid onto the image. If you wish, you can also periodically update the cover, or reset it to the snapshot originally taken by the system. Check out the documentation for more info.

function onEnterCover() {
  blackberry.ui.cover.setContent( blackberry.ui.TYPE_IMAGE,
        {path: "/path/to/an/image/windowCover.png"} );
  blackberry.ui.cover.labels.push({label: "Label 1",
                                 size: 15,
                                 wrap: false});
  blackberry.ui.cover.setTransition(blackberry.ui.cover.TRANSITION_FADE);
  blackberry.ui.cover.updateCover();
}

blackberry.event.addEventListener("entercover", onEnterCover);

The gold release is your cue to finish your BlackBerry WebWorks application so that you can leverage the first-mover advantage. Get out in front of the wave and be one of the first applications in BlackBerry World. And be sure to get your applications approved for sale prior to January 21st, and take advantage of the Built for BlackBerry program.

Download the gold release of BlackBerry WebWorks and put that final luster on your applications!

Did you enjoy this article? If so, we’d love to hear your thoughts on the Forums or on our Facebook page. Get more articles instantly on your BlackBerry smartphone with our Free BlackBerry 10 App.

Via

Enjoy this article? Share it with others.

  • Facebook
  • Twitter
  • StumbleUpon
  • LinkedIn
  • Digg
  • Pinterest
  • Google Plus
  • Tumblr
  • Reddit
  • Instapaper
  • Delicious
  • Email
  • Print