I am starting to realize that blog writing is similar to any other mental or physical exercise: it takes some time to knock the rust off if you take a break. Given how hard that first sentence was to write, I feel like red dust should be falling out of my ears. My robot vacuum cleaner needs to work harder to earn its keep anyway.

I do have a good excuse for my absence (I am not sure that Kinsella would agree). My first blog in a little while now comes to you from the sunny shores of Northern California. I have joined the (relatively) small but extremely dedicated contingent of BlackBerry employees fighting the good fight in the Bay Area. The relocation was no small task, let me tell you. Not the least of which was the four day drive from Toronto. I-80 is brutally efficient at getting you from A to B. But for some large segments, it is just brutal. Our dogs were also very efficient at letting us know when our travel day was (or should be) at its end.

But now I am setup here on the west coast, and fully in the middle of yet another move. If you missed BlackBerry Jam Americas in Orlando last month – nothing less than a cross-continent move will be accepted as excuse – you missed a very important BlackBerry 10 WebWorks roadmap session where we discussed the move of BlackBerry 10 WebWorks to use Apache Cordova at its core.

Fundamentally, the web is cross platform. While it is certainly not write-once/run-everywhere, the web does allow for a lot of reuse of code and assets. As mobile browser vendors continue to evolve and implement the various web technology standards, the amount of work to port an application becomes smaller and smaller. We are seeing web-based mobile applications become a much bigger piece of the total app pie. A large part of that is due to the success of Apache Cordova, which is the open source engine that powers Adobe’s Phonegap.

Our goal with BlackBerry 10 WebWorks is to ensure that we embrace the true philosophy of the open web, and empower our development community with the best tools and frameworks available to create rich web-based mobile applications. Moving BlackBerry 10 WebWorks to be based on Apache Cordova is a huge step in this direction and provides many benefits to our development community.

We are building support for BlackBerry 10 right into the core Apache Cordova project. This will allow Adobe PhoneGap developers to easily target BlackBerry 10 alongside other platforms for their mobile applications. BlackBerry 10 platform specific APIs will also be available as plugins for Apache Cordova (e.g. BBM, invocation, etc.)

As the center of gravity for packaged web applications, Apache Cordova garners a lot of attention from tooling and framework communities that will build their solutions to work with Apache Cordova. Having BlackBerry 10 as a core platform in Apache Cordova will help to ensure BlackBerry 10 WebWorks developers will be able utilize these tools as well.

To be clear, there are some differences in how you work with an Apache Cordova based application, specifically in terms of the command line tools, and some API signatures. All existing BlackBerry 10 WebWorks functionality does still exist, but the API signatures might be slightly different. Full documentation and porting guides will be available. The key thing to understand is that we have full compatibility built in. Applications built with an existing BlackBerry 10 WebWorks SDK WILL work on all 10.X code lines and new ones moving forward. Similarly, apps built with the new Apache Cordova approach will ALSO work on all 10.X code lines.

I am really excited about being part of the Apache Cordova community, and about the benefits and opportunities this will bring for our dedicated BlackBerry 10 WebWorks developers. Stay tuned to this blog and the developer portal for news on how the move to Apache Cordova progresses.

Most people like to be rewarded for hard work. There are of course many ways in which people derive reward. Fame. Adoration. Legions of followers on Twitter. Free cookies. But perhaps the most prevalent and obvious is cold, hard cash.

With BlackBerry World, there are a number of ways to get money out of your investment in your BlackBerry 10 application. Today’s refresh of the BlackBerry 10 WebWorks SDK brings support for ourPayment Service. The Payment Service allows you to implement in-app purchases, either one-time purchases or subscription-based services. Now you can choose your monetization strategy for your BlackBerry 10 WebWorks application: paid download, freemium, in-app purchases, digital goods, etc.

Check out the API reference to get started. You will immediately notice that there are a few new additions to the API compared to previous implementations in BlackBerry WebWorks, such as cancel subscription.

While payment should be enough to get your excited on its own, we also were able to sneak in some of the final bits of the BBM Social Platform – namely support for the Profile Box. The Profile Box is a customizable box for your app that appears in the current user’s BBM profile. You can use it to broadcast achievements or provide updates. The box contains a list of items, each composed of text and an optional icon. The Profile Box API allows you to manage the items in your app’s profile box. The API reference for this new API is here.

One final item that you should be aware of is how popup windows are handled. With this release, the popup blocker is disabled by default. This means that popups will display in the Child Browser window. If you wish to enable the popup blocker functionality there is a new parameter that you can pass in config.xml to the “blackberry.app” feature. For information, see the <param> element.

Last month we delivered the Gold release of the BlackBerry 10 WebWorks SDK to our development community. This was a huge milestone on the road to launch for BlackBerry 10, allowing our developers to confidently develop, test, and submit their WebWorks applications to BlackBerry World, and to take part in the Built for BlackBerry program. I am sure all of you have already submitted your apps and are now relaxing by the pool. ;)

Today we are launching a refresh to the WebWorks SDK that brings a number of fixes that, while not required for your application to run on BlackBerry 10, bring a few tweaks and stability improvements. There are two very specific updates addressing some underlying platform changes that COULD mean you will want to repackage an existing application. Let’s look at those first.

The concept of Cards in BlackBerry 10 is what really enables the Peek and Flow experience. There are many built-in cards that developers are able to leverage to complete common tasks or integrate with system services, and WebWorks has provided built-in APIs for some of these system cards. One of them is the File picker (blackberry.invoke.card.invokeFilePicker). In the gold release, you could provide a list of directories in the FilePickerOptions object, and the standard UI would present a selection list of those folders. This ability was removed from the standard UI. The API has not changed, but we only now look at and use the first entry in the array to seed the UI. So as long as you were not relying on this multi-directory functionality, or if you don’t mind that only the first is considered, then you have no need to repackage your application.

Another update relates to how Contacts are created, or more specifically, what happens when you save a newly created contact using the blackberry.pim.contacts API. In the Gold SDK, when you save a contact that you create using blackberry.pim.contacts.create(), it will always create a new entry in the device address book. The underlying native implementation changed slightly and will now attempt to merge it with an existing relevant contact entry if it finds one. If you are fine with this behavior, or if it is desirable, then you need to do nothing if you have already packaged with the Gold SDK. Otherwise, in order to preserve the behavior of creating a new contact, you will need to repackage with this latest WebWorks SDK refresh.

That’s it for compatibility concerns – not so bad. There is one other thing though that you will notice with the latest Dev Alpha update. If you are using the blackberry.invoke.card.invokeEmailComposer API, clicking the Send button actually does nothing. This has already been fixed on the native platform and will work at launch. You have no need to repackage your app, either now or later, as the fix is entirely on the device, but just something to be aware of if you use this API and are testing it on the latest Dev Alpha build.

Finally, let’s turn to a couple of the polish items that we have in this refresh. As most of you are probably aware, BlackBerry Balance allows the user to segment their device into multiple perimeters to separate work and personal. The enterprise perimeter can be locked if a password is enabled, and when locked, apps are “locked” as well. In order for you as the developer to know what the current state is, we have introduced events that you can listen for that will tell you when the perimeter locks while your application is open. Check out blackberry.system.perimeterlocked/perimeterunlocked.

We have also expanded the Contacts API to include the Accounts information for that contact. Check out the new field blackberry.pim.contacts.contact.sourceAccounts.

We recently added the ChildBrowser concept to WebWorks that allows you to support target=”_blank” and window.open in your web content. We also allowed you to disable it. With this release, if you disable the ChildBrowser and use target=”_blank” or window.open to display non-whitelisted content, the result will be opened in the system browser, rather than the user being presented with an access denied dialog.

Context menus and custom contexts have also seen a couple of improvements. When you add your own menu item to the context menu, the callback that is invoked when the menu item is clicked will be passed the id of the content element that the user long-pressed on. You can also now override existing menu items through the blackberry.ui.contextmenu.additem method. Just provide the platform action id in the additem call and you can provide your own text, image, and functionality for things like Copy, paste, and so on.

As you can see, unless you use one or two specific items, applications you have already packaged and built are still good to go. But if you do use the contacts API and wish to always create new items as oppose to merge, or if you used the file picker in a specific mode, you will want to repackage and resubmit your applications to 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 refresh of WebWorks today to polish up your applications before launch of BlackBerry 10!

Months of planning. More months of development. Re-planning. Long hours. Trips around the world. Meeting with you, our BlackBerry WebWorks development community. It all culminates with this: the gold release of the BlackBerry 10 WebWorks SDK. The team here could not be more stoked to deliver this final developer milestone on the road to the launch of BlackBerry 10. I apologize for the use of the word “stoked” in the preceding sentence, but I could not help myself. We are REALLY excited.

We recently delivered the final Beta of the BlackBerry WebWorks SDK in conjunction with our recent BlackBerry Jam Asia conference. With that release we began guaranteeing compatibility of your applications, which was a major milestone. Hopefully you have already started submitting your apps to BlackBerry World for approval and preparing your application to the Built for BlackBerry program.

Of course, the team has continued to work days – and many nights – to ensure this gold release is rock solid. Of course, we also snuck a few new things in.

We now have 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.

We have also now provided to you 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 has happily fallen out of favour (opinions my own and do not reflect those of my employer). But smartphone users love 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.

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.

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.

Even though this is the gold release, we know there are a few things still missing that we are working hard to deliver. The nice thing about BlackBerry WebWorks is that we can expose existing native platform functionality outside of device OS and native SDK updates. Keep an eye on the flight boards as we are actively planning maintenance releases to deliver a few more things.

But 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!

As we promised a few weeks ago, a BlackBerry® WebWorks™ SDK would be released soon that would have compatibility of applications moving forward. That day has arrived with the latest update to the BlackBerry 10 WebWorks SDK! Applications that are built with this BlackBerry WebWorks SDK will run on the latest delivered BlackBerry® 10 OS beta version as well as future OS updates.

Note that this does not mean that APIs don’t have the potential to change in the future, and there will certainly be more APIs added – but an application binary compiled with this SDK will continue to run on future OSes. With this guarantee, you can now build your BlackBerry WebWorks applications and submit them to the BlackBerry App World™ storefront for approval. You can now also apply for the Built For BlackBerry program before January 21st 2013 to take advantage of our 10k Developer Commitment to developers.

However, no BlackBerry WebWorks release would be complete without some new API additions. We have a ton of great stuff so let’s dive in.

Perhaps our biggest addition is the ability to integrate with the Calendar on the device. Create, edit, delete – it’s all there. It also delivers access to all calendars available on the device while of course respecting the work/personal boundary provided by BlackBerry Balance™. Combine this with the Contacts API delivered in the previous release for some very compelling applications that integrate with the BlackBerry 10 integrated PIM story.

Everyone likes toast (well, they should), and BlackBerry 10 has brought a mobile flavor to this breakfast staple with the Toasts notification concept. Toasts are quick, non-blocking notifications to the user that your application has performed some action, which are displayed for a minimal amount of time and then disappear. You can also enhance your toast with butter a button that allows the user to take some action in relation to that toast (eg. a toast that notifies the user that an item was deleted, and provides an Undo action). Check out blackberry.ui.toast for more on this one.

blackberry.ui.toast.show(“Pass the jam!”, options);

Now, wouldn’t it be cool if you could have a sensor in your phone that would tell you that your toast is ready before it was burnt? Well, no, we can’t do that (yet). But with this release of BlackBerry WebWorks, you now have access to a whole host of new sensor APIs. Orientation, light, proximity, compass, space-time disturbances; okay, not space-time, but yes on the rest. Leverage these APIs to add some real value into your application based on the device environment.

In the previous release of BlackBerry WebWorks, we provided a way to lock the orientation of your application by setting a flag in the config.xml. We have now provided a full JavaScript® API that allows you to lock/unlock your application dynamically based on your own logic. There are a few things to note with this change: To have a good JavaScript API signature, we are putting the orientation functionality right on the blackberry.app namespace, but this is out of line with the current config.xml approach of putting the parameter on the blackberry.app.orientation feature. So we have deprecated this, and now you should put orientation in config.xml on the blackberry.app feature. Also, if you do choose to set it in config.xml, that is a constant value that cannot be overwritten by the API – what you set in config.xml is what you get.

Speaking of config.xml, with this release we have all the pieces in place to allow for full localization of your application, including the display name of your application as well as the description. In the config.xml, you just need to put the localized text inside another element with the xml:lang attribute for the language. Furthermore, all of the built-in UI components are fully localized and reflect the current system language.

Let’s now take a look at some enhancements made to the underlying BlackBerry WebWorks platform. With this release, we have delivered a number of different optimizations to the runtime initialization process. Lots of highly technical, egghead type stuff. Long story short – your apps should load a whole bunch faster for your end users. Be sure to get the latest BlackBerry 10 OS build to see the full benefit.

Perhaps even more interesting is the addition of a child web view control. If you have a link in your content with target=”_blank” or use the window.open function, the content will now be loaded in a child web view that looks much like a card and won’t overwrite your current content. The user can then cancel the view to return to the originating page. When you use window.open, you will receive a window object for the child web view. One of the more obvious use cases here is a more seamless method of supporting OAuth for authentication into social networks like Facebook®, foursquare, Twitter®, and so on.

We have also added a new attribute to the element in config.xml that allows you to specify a single HTTP header key-value pair. This HTTP header will be added to every HTTP request sent from your application. This allows your backend system to key off of this header and perform any required customized processing for your app.

<widget rim:header=”header:Goooallll!”>

If that wasn’t enough on its own, we have also added a few new tooling features that should make your life a lot easier. First on deck is the ability to pass your application’s root folder into the bbwp tool to package your application. No more requirement to first zip your application content and risk feeling silly when you forget to update your zip file with your latest changes. The packager also supports ignoring folders and files within your application folder hierarchy; just create a “.bbwpignore” file in the root folder and list the folders and files you don’t want to be part of your application packager. The format of this file is essentially the same as the .gitignore file, with one or two very small differences.

Another potential time saver and headache reliever is a new facility that will allow you to forget about ever needing to update the version of the webworks.js file you reference in your app. In your application files, reference the webworks.js file like so:

<script src=”local:///chrome/webworks.js”>

The packager tool will include the latest webworks.js into your package and put it at the appropriate location to be loaded.

So there you have it. It is worth reiterating that with this release you can now submit your apps to BlackBerry App World and be assured they will run properly come launch of BlackBerry 10! So submit early so you can get your application approved, and then apply for the Built For BlackBerry program before January 21st, 2013. No time to waste – grab the SDK today!

]]>http://devblog.blackberry.com/2012/11/blackberry-10-webworks-sdk-updated/feed/0kjwallisTITLE_IMAGEUpdate – Built for BlackBerry and apps built with the BlackBerry 10 WebWorks SDKhttp://devblog.blackberry.com/2012/10/blackberry-10-webworks-sdk-program/
http://devblog.blackberry.com/2012/10/blackberry-10-webworks-sdk-program/#commentsWed, 31 Oct 2012 18:06:34 +0000http://devblog.blackberry.com/?p=11843/ Read More]]>One of the most exciting programs we have in place for mobile developers looking to embrace the opportunities provided by BlackBerry® 10 are the Built for BlackBerry program and the $10k commitment. With these programs, applications that meet a certain set of criteria that are submitted to the BlackBerry App World™ storefront, that are approved before January 21st, and that are accepted into the Built for BlackBerry program will be guaranteed to make at least $10,000 in the first year, or RIM® will make up the difference.

There has never been a better time to build for BlackBerry. If you are a web developer, building with the BlackBerry 10 WebWorks™ SDK is your path to the Built for BlackBerry program and the $10k commitment.

Now, while BlackBerry App World is accepting application submissions (as of 10/10/2012) for BlackBerry 10, you will want to hold off on submitting your BlackBerry 10 WebWorks applications for just a short while. Using the current publically available BlackBerry 10 WebWorks SDK, you can build, package, and test your application against the current BlackBerry 10 OS builds available in simulators and the BlackBerry 10 Dev Alpha testing device. However, those same applications will not work in upcoming builds of the BlackBerry 10 OS, so your application would be rejected by the BlackBerry App World team.

Unfortunately, unavoidable changes were made in the underlying web runtime that broke compatibility. Have no fear; the development team is hard at work ensuring that the next release of the BlackBerry 10 WebWorks SDK – due in November – will ensure compatibility moving forward. You will NOT have to change any of your code; this will simply be a repackaging exercise with the new SDK to create an application package that will run correctly on the latest BlackBerry 10 builds.

So hang tight for our next release of the BlackBerry WebWorks SDK – which in itself has some cool new features that you will love – and then get submitting to BlackBerry App World!