BlackBerry® 10 Native SDK Beta 2 introduces new functionality to both the Native APIs and IDE.
At the C API layer, we have introduced some important new functionality such as the Invocation Framework API, NFC, Geocoding, Cryptography, Audio Manager, Slogger2 and Notifications Manager. As you can tell, the teams have been working hard since the release of Beta 1 to bring all this functionality to you.
The invocation framework enables the delivery of invocations between end points. It describes how end points can be addressed, and provides a mechanism for registering and brokering event handlers such that invocation sources may be loosely coupled to the handler. The invocation framework provides an advanced brokering scheme that allows it to address many different service scenarios, and also to easily be extended to cover new cases.
Your app can register as either a source or a handler. A good example of a source app is an app that supports nested URI’s, and requires a URI handler to handle the URI request. Your app can leverage the invocation framework to broker and determine the best handler for this URI – the assumption here is that there are handlers registered for this on the system. Alternatively you can develop an app that registers as an invocation target – for example, an NFC handler that registers interest in certain NDEF tags. When the NFC service reads a tag, it will leverage the invocation framework to find the best fit handler for that tag and invoke your app. We also support the Invoke API at the Qt layer, so if you are developing a Cascades™-based app, you may want to use the Qt-based invoke API as opposed to the C-based API. We also have built-in support for invoking the Cascades Action Bar and Context Menu. This support is now integrated in our Cascades UI Framework. Please refer to the following Knowledge Base article for details on some known issues which will be addressed in an upcoming patch
NFC (Near Field Communications) is a short range protocol that is used for contactless communication between devices and tags. Our NFC API will support multiple NFC use cases such as Bluetooth®/Wi-Fi® pairing, NFC contact exchange, reading and writing tags, contactless payment and so on. The possibilities here are endless and I look forward to some really innovative NFC apps for BlackBerry 10 smartphones.
If you care about cryptography, you are in luck as we now expose our Certicom APIs for encryption and decryption of data streams. Those of you who have worked on our Java-based BlackBerry platforms might have some familiarity with what these APIs are capable of. They provide a whole slew of symmetric and asymmetric encryption algorithms such as AES, DES, RSA, ECIES and many more. Along with this, we provide various algorithms for key agreement and transport such as DH, ECDH, ECMQV, RSA, a variety of digital signatures, numerous SHA, MD and HMAC hash functions and random number generation.
For developers working on apps with audio content, we have introduced a new audio manager API that provides audio concurrency services. The audio manager allows you to choose which microphone and speaker to use. It also provides APIs to get information about different microphones and speakers so if you need that degree of control this API should provide what you need.
Native SDK Logging with slogger2
With slogger2, the most important thing that you gain as a developer is speed. Slogger2 will have minimal system overhead and will be several times faster than the original slogger. Slogger2 will also log when interrupts are disabled, which might be of use to those hardcore low-level developers who require this type of capability. If you have code that uses the slogger APIs, don’t worry — we will continue to support it. Our slogger2 APIs will happily co-exist alongside the legacy slogger.
Some apps may want to send notifications to the user – for example, say an app that communicates with the cloud wants to inform the user when new data has been uploaded. The app can register with the notification service to send such a notification. We support simple LED notifications, sound and vibration, toast messages, dialogs, and Inbox notifications. Apps that want to leverage this service need to indicate this by specifying the post_notification action in their bar descriptor. The user will have the ability to customize the notification through the notification settings dialog.
Cascades Platform (C++) APIs
I’ve already used up so many words and haven’t even touched upon the C++ APIs yet! On the C++/Qt side of things, we’ve introduced a whole set of new APIs such as invocation API, Barcode processing, vibration control, copy and paste, and video capture (plus I already described the invoke API earlier). The C++ invoke API is similar in scope to the C layer API and is geared towards folks writing Cascades apps who would naturally be working with the Qt paradigm and would benefit from a Qt API.
Barcode Processing is a new API that was developed for encoding and decoding QR codes. While we’ve made the basic encoding and decoding functionality available to non -Cascades apps, the real interesting use cases would occur in conjunction with Cascades apps. The barcode-extended APIs in the Cascades namespace that will allow apps to create and display a barcode scanning control, which will in turn trigger the camera API to show a viewfinder surface as a Cascades foreign window. The app can then scan the QR code and use the provided APIs to encode it as a string and display it on screen.
In addition to this, you will also have APIs that allow your app to customize properties of the Viewfinder surface such as size and location.
Video and Camera
Speaking of camera, we now provide APIs to control camera settings and capture pictures within an application. This allows you to develop apps that interact with the camera, as well as ones that programmatically request a still image from the camera and start a video stream recording.
For developers creating location-based apps, we have added a subset of the QtMobility location APIs. We have introduced APIs for querying current location such as latitude, longitude and altitude. We expect to continue to evolve this API in subsequent releases and plan to provide APIs for geocoding shortly. However, I should mention that we will likely not end up supporting the entire QtLocation API – certain functionality such as maps will be covered by Cascades-specific APIs in upcoming releases.
Vibration Control and Clipboard
Last but not least, we provide a C++ API for vibration control and a clipboard API, both of which are similar in scope to the C layer APIs we already provide. There have also been a myriad number of bug fixes, enhancements to existing APIs and optimizations, which are too many to list in this blog. The best way to explore all these changes is by downloading the NDK and taking a look at the headers, documentation and samples.
On the tooling front, we’ve introduced some neat features such as invocation framework tooling, an option for faster bar deployment time, and pretty printing of objects in the debugger. More importantly, we also allow you to specify multiple icons and splash screens in your bar file. This is important for when we start releasing new devices based on the BlackBerry 10 platform, such as the BlackBerry® PlayBook™ tablet. To make it as easy as possible for you, Beta 2 of our IDE will allow you to package multiple icons and splash screens in your bar so that the bar can be deployed on multiple targets.
One of the challenges in writing a blog post like this is that there is a lot of content to present, and unfortunately I can’t do justice in describing all the functionality being released. My colleagues on the Developer Relations side and I are hoping to deep-dive into some of these technologies in dedicated blog posts that we plan to publish in the near future. Meanwhile, I hope this blog post provides at the very least a map of what’s available in Beta 2.
For more information, you should download our NDK on our website and take a look at the new headers. You can also navigate to our NDK documentation and API reference to get more information on each of the APIs. If you still aren’t satisfied, please do not hesitate to consult our developer forums if you have questions or need support. API requests and feedback about our APIs are also very much welcomed — if there is an API you need on our platform, we want to hear about it so we can help unblock you. Happy coding!