0
Posted July 19, 2012 by Rapid John in Developers
 
 

BlackBerry 10 WebWorks Update Now Available

BlackBerry 10 Swipedown
BlackBerry 10 Swipedown

BlackBerry 10 WebWorks SDK Refreshed and Updated

RIM have just announced the release of a new version of the BlackBerry® 10 WebWorks™ SDK.  It really provides a platform to build on for making high quality, integrated BlackBerry® 10 applications using web technologies. It also provides the groundwork for future updates throughout the summer and fall, filling out the API set to support a wide-range of use cases.

Invoke

You will be seeing a lot about the Invoke framework when it comes to BlackBerry 10 application development. Invoke provides the mechanisms for interacting with other applications and services on the device, both system and third-party. And it works both ways: you can invoke another application to access some functionality; you can register to be a target for invocation based on a pre-defined or custom “Action”, and for specific types of data.

Needless to say, you will want to get intimate with this API, as it is one of the cornerstones of the BlackBerry application value proposition of deep integration with the system and third-parties.

Please refer to the following Knowledge Base article for details on some known issues which will be addressed in an upcoming patch.

File and File Transfer

In previous versions of BlackBerry WebWorks for BlackBerry® OS and BlackBerry® PlayBook™ tablet, there was a blackberry.io.file API to allow for management of files on the device. With the latest version of the WebKit engine, there is now support for the HTML5 File specification, so this is your route to file system access on BlackBerry 10. This is in keeping with our general strategy of alignment with the open web and standards.

One thing to be aware of with the File API is that, by default, it will act exactly like in a typical browser environment in that the application will only have access to a local sandbox area (enforced by browsers for security reasons). Since application development is different from a browser-based environment, we have provided an API (blackberry.io.sandbox = false;) that will allow you to create an un-sandboxed file system that will be at the root of the device file system.

Also in blackberry.io are a couple of properties that direct you to points of interest on the filesystem, such as the Shared folder, and the home folder of the application which are useful in an un-sandboxed environment. Device permissions for read/write etc. are enforced, as well as perimeters in a BlackBerry® Balance™ environment (i.e the blackberry.io.sharedFolder property will point to the correct Shared folder in the perimeter that the application was installed into.). Whitelisting is enforced on domains when it comes to the sandboxing logic, so security is preserved.

One of the key things we were missing for BlackBerry OS and BlackBerry PlayBook OS was the ability to work with remote files. Being able to upload and download files is a natural extension of the filesystem API, and with BlackBerry 10 you can now create an app to upload to the interwebs as many pictures of your food as you like. Check out the blackberry.io.filetransfer API. Your filesystem just got more powerful.

blackberry.io.filetransfer.download(
        "http://myfiles.org/mypdf.pdf",
        blackberry.io.sharedFolder + "/downloads/mypdf.pdf",
        function (result) {
              alert("Download successful");
        },
        function (result) {
              alert("Download failed");
       } );

Push

This is one of the hallmarks of the BlackBerry solution: getting relevant information right away, without having to ask for it. This is Push. And in keeping with every BlackBerry WebWorks platform to date, you can integrate your application with Push-enabled services using the blackberry.push API. The APIs are more streamlined in BlackBerry 10, especially in that it abstracts away the differences between BlackBerry Enterprise Server and BlackBerry Internet Service push, so you no longer need to worry about that. Watch this space for a dedicated article on the Push APIs coming soon.

Context Menu

One of the UI cornerstones for BlackBerry 10 is the context menu. When the user of your application long-presses on an element in your page, the context menu will slide in from the right and present standard actions for the given context. So when the user long-presses on an image, you will get actions such as “Save Image”. At this stage, the context menu will be populated with system defined actions.

Swipe Down Event

A small event, but oh so powerful. The swipedown event will be triggered when the user swipes down from the top bezel into the application content. What most people will use this for is to render a menu that comes in from the top of the screen, as you will find with many applications on the BlackBerry PlayBook tablet. Often this menu will be used for application settings and options. You can also find a very useful sample of how to make this happen in our open source GitHub repo athttps://github.com/blackberry/WebWorks-Samples/tree/master/swipemenu.

Multiple, Localisable Splash Screens and Application Icons

With this release, you are now able to specify multiple icons and splash screens for your application. This is to cover different screen resolutions in the future, and for when the device orientation changes. Make sure you have a splash screen for both landscape and portrait orientation. Further, you can also specify splash screens and icons for different languages. When the device language is changed, the system will use the appropriate icon or splash screen. This is accomplished through a folder in your application called /locales. And all you need to specify in your config.xml is the main version of the images, and the system will take care of the rest. See the documentation for more details.

Click here to download the new SDK.

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.

Source: BlackBerry DevBlog

Enjoy this article? Share it with others.

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