API – BlackBerry Developer Bloghttp://devblog.blackberry.com
Mon, 19 Mar 2018 12:26:35 +0000enhourly1http://wordpress.com/http://1.gravatar.com/blavatar/9ef0a66c09615fa946c4179662398878?s=96&d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.pngAPI – BlackBerry Developer Bloghttp://devblog.blackberry.com
How to Integrate the BBM Enterprise SDK into a Regulated Organizationhttp://devblog.blackberry.com/2017/09/how-to-integrate-the-bbm-enterprise-sdk-into-a-regulated-organization/
Thu, 07 Sep 2017 17:57:47 +0000http://devblog.blackberry.com/?p=24625/ Read More]]>Regulation and compliance are two key factors when it comes to deploying any software into a business-oriented environment. Most importantly, the software must be secure to prevent data leakage and to avoid users and their data from being compromised.

The BBM Enterprise SDK uses the same technology as the BBM Enterprise Application, which is in use within regulated industries and government security agencies. It easily utilises either an existing cloud-based storage provider or one that a developer builds on his or her own. This is so that the keys remain in the hands of the clients, and the secure data is indiscernible to everyone else, including BlackBerry.

Firebase is one example of a cloud-based provider that is commonly used. However, there are some instances where the regulated environment cannot support Google Play Services and other related components – such as Firebase storage – which is why BlackBerry provides developers the flexibility to choose an existing system or implement their own. This is why BlackBerry architected the BBM Enterprise SDK the way they did. It enables developers to have choices with identity providers, key management, storage, and social graph, all while remaining both secure and efficient.

The BlackBerry SimpleChat sample was built using Firebase so that the basic needs of identity, public and private key storage, and data storage for contacts could be achieved by a developer in very few steps.

At Tundra Core Studios, we made the most of the flexibility of the BBM Enterprise SDK by integrating our own identity provider, key management system, and storage provider. Let’s get into the specifics of how we integrated Identity Management between our application and the SDK. We use a token-based system which then authenticates the SDK with our application through the use of the ‘AuthToken’ in the SDK, which is tied to a unique identifier specific to the authenticating user.

As for the integration of the user profiles and social graph information, we create endpoints to interact with our API –as we have sub-classed and extended the ‘AppUserSource’. This provides us with a direct connection to store information about a user within the BBM Enterprise SDK and with our API. This can be shared amongst other users where they can then go onto initiate conversations with the different participants.

The key storage management is one of the most important factors to ensure messages can be sent and received within our application. Whilst to some, integrating a key storage management system from scratch would appear as a difficult task, we simply extended our API that was previously used for the user profiles and social graph. We then use this information to implement secure key storage.

This was simple and we only needed to create a few additional endpoints (which interact with our API). The BBM Enterprise SDK already provides callback methods to enable the exchange of the relevant keys, both with its internals and with an external network for information upload.

Plugging into the ‘KeyStorageProvider’ provided us with the exact callbacks we required to communicate with our API, allowing us to upload the cryptographic keys required to secure conversations and user accounts.

The BBM Enterprise SDK is built in a way that allows developers to use any cloud-managed storage provider they like. In our case, we appreciated the flexibility to build and use our own services. Now that we have been able to successfully replace Google Play Services and Firebase, we are looking to extend our API even further to allow information to be shared between our proprietary suite of applications (Secure Chat, Secure Mail and Secure Notes), as well as where contacts can be synced and shared.

Users also now have the ability to share notes directly into Secure Chat and Secure Mail, as we have created the functionality to file share—within Secure Chat—by accessing your corporate network drives.

BlackBerry NOC provides the secure communication infrastructure. All BlackBerry Dynamics applications maintain a persistent connection to NOC by using SSL over TCP.

Direct Connect

IT Admins can also enable a BlackBerry Dynamics app to connect directly to a GP server without connecting through the NOC. Some organizations have additional data privacy requirements, restricting user data leaving from their networks therefore do not want their users and enterprise data to be routed via the BlackBerry Dynamics NOC.

These routing options can be configured in the UEM(Unified End-Point Manager) or stand-alone GC(Good Control) by IT admins and are transparent to the application code as the BlackBerry Runtime will handle the appropriate route automatically.

Let’s dive into the environment set up and platform specific APIs to access BlackBerry Dynamics secure communication. To establish the secure communication between your BlackBerry Dynamics app and enterprise application servers, the server information (host name and port) are configured in the enterprise management console such as UEM or GC.

Once UEM or GC server is configured for your application server(s), your app can use the BlackBerry Dynamics secure communication APIs to access the server(s). The platform specific APIs are listed below:

In the SDK for Android, you can use:

GDSocket class for socket connections and

GDHttpClient class for HTTP requests.

In the SDK for iOS, you can use:

GDSocket class for socket connections and

GDURLLoadingSystem with the native HTTP Request framework such as NSURLSession or NSURLConnection class. At the time of writing this post, NSURLSessionDownloadTask is not yet supported.

GDHttpRequest class for an alternative stand-alone interface

In the Cordova Plugin for Android or iOS, you can use:

GDSocket class for socket connections and

GDXMLHttpRequest class for HTTP requests

Secure communications APIs are available for Xamarin, Windows, macOS as well. For more details, check out the BlackBerry Dynamics Resources page.

That’s it for now! Stay tuned for our next blog…

Click here to join our Developer Community forum and the conversation!

BlackBerry UEM is the first release of our core EMM solution to include public REST APIs. For legacy BES users, BWS (BlackBerry Web Services) was the sole API for programmatically invoking actions on BES and was built on legacy SOAP calls. Good Control, the core EMM Good solution similarly had a collection of SOAP calls, but at the time of its purchase by BlackBerry was already starting down the path of REST API’s. With the release of UEM, REST now takes prominence as the future of API calls from the legacy of both previous products.

Why REST?
Primarily two reasons. First, performance. REST calls are tight, minimal JSON objects compared to the broad, rather descriptive calls that SOAP requires. Not particularly friendly to mobile communications given the slower speeds and bandwidths available to mobile users. 2) its JSON, and its 2017. Developers frequently use JSON objects as there default payload whether in web development or native apps. Developers expect to see JSON, not xml. So, as part of the migration from BES/GC to UEM, REST, full speed ahead.

What’s available in the first launch?

REST API’s use the same port and authentication scheme the older BWS interface (port 18084).

EMM functions provided by Good Control have been ported to UEM as REST calls

The initial launch of REST API’s is a short list, but will be growing on each release as we update older calls from SOAP to REST.

As new features are added to UEM, you can expect access to them as new REST API’s.

Note: BWS calls that were in BES12.5 are STILL there, and will remain unchanged.

How to get started…There are many ways to invoke a REST API, commonly, you can build your own (Java, .Net, Javascript, etc.) The online doc’s show samples using the command line tool CURL, but I prefer using a nice UI. I recommend using a modern UI based tool, in this case, I recommend Postman (https://www.getpostman.com/apps )

Where the value of password is base64 encoded. This is a bit of a pain. There is no base64 encode command built into Windows (what I’m using). Search for a solution, there are lots, but, if you’re a fan of Notepad++, it does include this as a feature. Simply type in your password (I’m literally using password), highlight it, right click on it, choose plugin commands, Base64 Encode, like so:

Copy and paste the result into the field above.

Here it is with the body displayed:

Here it is with the Headers displayed:

And after you press send with your POST you should see the authorization string you will need:

Recently there was a requirement from customer (major bank) to a create messaging application that can listen for inbound and outbound messages, for the Android-powered BlackBerry PRIV device. I wanted to share my experience of how I implemented the solution by making a sample application. It is useful for developers, if they need to perform some action when a message is sent or received (block it, log it, etc.). At the end, I have provided the GitHub links for downloading the code, for you to extend and use for your own needs.

Implementation:

When the sample application is installed on the device, any SMS you receive or send is reflected by toast. A service class is used which runs at back-end and listens to the messages. A Content observer is registered in the onStart() method of the service, to listen for the changes in the content of the messages.

Security for the application is provided by the BID framework. By using the BID framework in our application, we can ensure that the application will only run when the device is in a secure state. Currently this feature is supported only on BlackBerry devices running the Android operating system.

Support for Enterprises:

The application can also be leveraged in enterprise environments, as it is also supported when used with Android for Work and Samsung Knox frameworks.

For more information about the installation and usage of Android for Work, feel free to refer to: Developing Apps for Work

BlackBerry UEM version 12.6 is a service pack (SP) update of the EMM solution formerly known as BES12.

BlackBerry UEM version 12.6 introduces BlackBerry UEM Web Services, which are a collection of REST APIs that you can use to create applications to manage your organization’s environment. The following REST APIs are available.

API name

Behavior

Activation passwords

User activation password management.

Applications

Provides access and management of applications.

Company directories

Provides management functions for company directories.

Email templates

Email templates are used for sending activation information or compliance violation notification emails.

Groups

Provides access and management of groups.

Ping

Used to determine if the server is up and available.

Profiles

Profiles provide the ability to assign functionality to a user or group.

]]>uem-12_6colinfullertonuem-12_6How AppDome and BlackBerry Are Democratizing Software Development, One SDK at a Timehttp://devblog.blackberry.com/2016/11/how-appdome-and-blackberry-are-democratizing-software-development-one-sdk-at-a-time/
Tue, 29 Nov 2016 21:21:50 +0000http://devblog.blackberry.com/?p=22918/ Read More]]>You can wash your clothes down by the river with a bar of soap and a rock, sure. But why would you, when washing machines and drycleaners exist? Technology has stepped in where manual labor used to pervade.

The job of the developer is to translate business objectives into lines of code. That’s a hard job, and it seems like in every organization, the development team has a backlog of features and requests that they want to add. They want to make apps better, solve more problems, and make the experiences better overall for users.

There are two ways this can be accomplished.

Software Development Kits (SDKs) allow developers to build custom functionality into their apps. Application Programming Interfaces (APIs), meanwhile, allow you to incorporate a feature or set of features from another application platform – the Google Maps API, for example, lets you add location services to apps. APIs sit inside SDKs, which often comprise more than the API itself.

In many cases, a development team will make equal use of both APIs and SDKs. Here’s where the problem arises. For an API or SDK to work with an application, it must first be integrated into that app.

The application must be modified to incorporate the new tool. This is a process that takes time and skill. However, not all organizations have either at hand. What if I told you integration could be done without either?

Say hello to AppFusion. This tool allows you to implement complex mobile services and SDKs to your applications in a matter of minutes. And now, thanks to BlackBerry’s Good Dynamics app platform, it’s better-equipped than ever to integrate new platforms and services with the push of a button.

The advantages of this ease of integration go well beyond a few saved man-hours. With BlackBerry, we’re taking an existing toolkit and applying it in places it’s never been applied to before. Organizations can now apply the rich app-level security controls of Good Dynamics to existing apps without writing a single line of code or even to third-party apps.

Suddenly, everyone is empowered with the ability to bring in additional functionality – they don’t need to be a software engineer to do so. It opens up the possibility that a new class can participate in the mobile development process. And that, in turn, leads to better collaboration, better applications, better workflows, and better outcomes.

Let’s say, for example, you have a security team and a dev team. The developers aren’t security experts, and the security experts aren’t developers. With AppFusion, the security team could recommend or select the services to be connected in a solution, and could promote those selections to the developer. All the developer has to do is click “Fuse My App,” and the security team has what they requested.

AppFusion’s also great for commercial ISVs. These application providers often serve a large portion of enterprise customers, and need to implement their SDK manually for every vendor whose store they want their apps to appear in. With AppFusion, they needn’t take on that burden.

And as more people use AppFusion, the technology is going to get better and better – every single update to the technology impacts and benefits every other user. It takes the notion of implementation from an individual discovery into a journey that serves an entire community. And with BlackBerry as a partner, there’s nowhere to go from here but up.

]]>Giving their design the seal of approvalinsideblackberryblogShot of young designers working around a laptop in an officeCaucasian businesswoman smiling at computerRecorded – Enterprise Developer Webcast Series: Secure Storage & Communications for Android using the Good Dynamics SDKhttp://devblog.blackberry.com/2016/08/live-enterprise-developer-webcast-series-secure-storage-communications-for-android-using-the-good-dynamics-sdk-2/
Tue, 02 Aug 2016 18:22:05 +0000http://devblog.blackberry.com/?p=22621Missed last week’s webcast?

Secure Storage & Communications for Android using the Good Dynamics SDK

WatchDox Overview for Developers and New Good Dynamics Release

]]>blackberry-emblem-cropinsideblackberryblogLIVE Enterprise Developer Webcast Series: WatchDox Overview and New Good Dynamics Releasehttp://devblog.blackberry.com/2016/06/live-enterprise-developer-webcast-series-watchdox-overview-and-new-good-dynamics-release/
Fri, 24 Jun 2016 18:10:15 +0000http://devblog.blackberry.com/?p=22468/ Read More]]>Learn about WatchDox APIs and business use cases and get the latest updates on the new release of Good Dynamics with SDK support for Swift and Mac OS X.

This webcast will cover:

WatchDox API & SDK’s – Overview for Developers

WatchDox by BlackBerry Enterprise File Sync and Share (EFSS) product is the most secure enterprise file sharing and collaboration solution in the market.

In this session we will share a developer overview of the WatchDox API’s including business use cases.

An Overview of the New Good Dynamics Release

Product Management will provide an update on the upcoming release of Good Dynamics with SDK support for Swift and Mac OS X

With Good Dynamics create engaging mobile apps for business users and let the platform take care of all the security, backend, and infrastructure services your apps need

Identity & Authorization APIs

The first GD (Good Dynamics) API call made when an application starts is the authorize call which authorizes the end user and establishes a connection between the application and the GD platform. Two types of activations occur:

Calls to other GD APIs cannot be made until the authorize call is complete.

A GD application is uniquely identified by the GD Entitlement ID which uses a reverse domain name convention (e.g. com.good.gd.examples.remotedb). This identifier never changes. There is also a GD Entitlement Version used to identify new functionality in the app such as a shared service. This version number rarely changes.

Secure Storage APIs

There are 2 basic secure storage APIs, the File System and Database.

The File System API behaves like the default file system. But, all data within the secure file system is stored on the device in an encrypted form transparently to the app.

The Good Dynamics secure SQL database is based on the SQLite library. Encryption is added transparently to the app. Only the open call needs to be changed to use sqlite3enc_open.

Secure Communication APIs

The basic secure communications APIs are based on HTTP and TCP sockets. For either API, the application server can be on the Internet or on-prem behind the firewall. The GD HTTP Request API is based on the XML Http Request (XHR) standard. HTTPS security is supported as well. In either case no code changes are required and encryption/decryption is transparent.

The GD Socket API is for bi-directional data communications. SSL and TLS are supported. The GD Socket API is asynchronous and state-based. For more information, a recording of our webcast Good Dynamics Client – A Look at the Basic Security Services APIs (Part 2) from March 1st is available here.

]]>good_logo_featurerbschaefergood_dynamics_platformgood_dynamics_clientGreat Apps on BlackBerry! A Strong Commitment to the BlackBerry Developer Communityhttp://devblog.blackberry.com/2016/03/great-apps-on-blackberry-a-strong-commitment-to-the-blackberry-developer-community/
Thu, 17 Mar 2016 17:51:22 +0000http://devblog.blackberry.com/?p=21455/ Read More]]>The app landscape continues to evolve, and in ways that are not always within our control. Recently, Facebook made the decision to discontinue support of their essential APIs for BlackBerry and WhatsApp announced they would end support for BlackBerry 10 and BBOS at the end of 2016.

We are extremely disappointed in their decision as we know so many users love these apps. We fought back to work with WhatsApp and Facebook to change their minds, but at this time, their decision stands (but let them know how you feel on social media, using the hashtag #ILoveBB10Apps). Despite this, we have worked hard to ensure our end users have the best experience in light of this decision, and are continuing to search for alternate solutions.

Our commitment to BlackBerry 10 and to developers has not changed – we know our developer community continues to be one of the strongest proponents of BlackBerry 10 and they are creating thousands of apps every month. As a way to support them and to promote new apps, we’re now featuring some of the best native applications on BlackBerry World in a list called “Great Apps on BlackBerry.” The category will be a list of 20 applications, featured for two weeks, once per month, similar to the way we feature apps on the BlackBerry World Carousel. We’re also continuing whenever we can to invest in apps important to users, such as the update to the Twitter app released today with important fixes and another update coming in a month with new features. This ensures that our many BlackBerry 10 customers have the best OS and apps possible.

We look forward to new apps and new customers on BlackBerry 10 and thank our developer community for their continued strong support!

I am excited to share how to create a Good-Secured app as part of the Good Dynamics SDK series. If you haven’t already, check out part 1: Good Dynamics SDK Overview.

Let’s get right to it.

Step 1. Sign up for Good Developer Online Account. It’s Free!

Your first step is to register for the Good Developer Network community. Your Good developer online account will give you access to a variety of online resources including Good SDKs and plugins.

Step 2. Install Good Dynamics SDK

The Good Dynamics Platform provides a range of SDKs and plugins, allowing developers to build native, hybrid or web apps on iOS, Androids and Windows. You can download the Good SDKs and plugins here. Check out the Getting Started Guide for each platform to learn how to install the Good Dynamics binaries and supported features for the platform.

Step 3. Create a New App using Good Dynamics Template via Xcode(iOS)

The next step is to build the Good-secured app. I’ve created a simple Good-Secured iOS app using the Good Dynamics app template (Figure 1) from the Xcode project.

Figure 1: Good Dynamics App Template in Xcode

Step 4. Configure App to Run in Enterprise Simulation ModeOnce you create a project using the Good Dynamics (GD) template, you have a Good-secured app. The app will have to go through the same secure activation process that all users of Good-secured apps experience. When you first run the application, it will prompt you to activate the app on the Good Dynamics infrastructure. To fully test that process, you will need to set up the Good Dynamics platform environment. However, you can skip this step for now if you just want to prove that the app works.

To get around the full activation process and test the app, run the app in Enterprise Simulation mode. This allows testing of Good-secured apps prior to a full deployment of the Good Dynamics Platform management infrastructure.

To enable Enterprise Simulation mode, browse to the project’s Info.plist file in Xcode, add a new row, enter the values as below, rebuild the app and run it in the simulator.

Step 5. Build and Run your Good-Secured AppThat’s it – you can now build your first Good-secured app and get it running.

Step 6. Activate and Provision the AppWhen your app is running for the first time on the iOS simulator, you’ll still be prompted to activate the app, but this time you can enter any email address and any 15-character access key to complete the activation process (Figure 2).

Figure 2: Good-Secured App Activation in Enterprise Simulation Mode

The app will go through the enterprise activation process and once the app has been activated, you’ll be prompted to create a password to access the app. The “Password Requirements” link at the bottom of the screen provides guidance on required password complexity. Password complexity is controlled via policies managed by the IT Admin via Good Control management, which is a topic for another blog. For now you can just choose a simple 4-character password (Figure 3).

Figure 3: Enterprise Activation and Password Requirements

Step 7. You’re Done!

Where do you go from here? Depending on your level of interest, here are some suggestions:

Browse through the sample app to get familiar with how the Good Dynamics classes are used. Modify the code to see what changes in the app. The sample apps are available with the Good Dynamics SDK distribution. On iOS, the apps are in the /Good Technology/Good.platform/Examples directory. On Android, look in the “samples” sub-directory in the directory where the Good Dynamics SDK is installed

Make your own app into a Good-secured app: Use code snippets from the Good Dynamics sample app to start porting your existing app to the Good Dynamics Platform

Extend sample apps: Add in functionality to make your own Good-secured app

To test your app on a physical device, just remove the plist entry for the GDLibraryMode key and rebuild the app. You will also need to set up a Cloud Good Control or Good Controls and Good Proxy for on premise deployment. The Cloud Good Control only works for apps without server backend. That’s for another post.

The Good Dynamics platform consists of 3 components: the SDK library compiled into applications, the Network Operating Center and servers, the Good Control and Good Proxy. Policies (e.g. idle timeout value) and actions (e.g. wipe) to control the application are set by the admin on the Good Control console and implemented by the NOC and library. Several platform services are built-in and require no coding such as Identity, Access Management and Single Sign-on Authentication between apps and on server side.

Good Dynamics clients can be native or hybrid apps using frameworks such as Cordova. Regardless, they are built with the GD APIs:

Shared Services APIs – for consuming and providing services from apps and servers

With these APIs, data is protected while in use, at rest and in transit, whether between apps or apps and servers. The Shared Services APIs provide secure linkage between apps enabling the programmer to build secure workflows for business use cases. This is the most powerful feature of Good Dynamics. For more information attend our webcast on February 2nd at 11am ET.

Sometimes you don’t have the time to read everything as soon as you discover it. It’s the same for users of your apps as well. For that reason it could be a good fit to add Pocket integration to your apps. For those of you who don’t know what Pocket is, it’s a so called “read it later” service, available cross platform for multiple devices. Pocket enables you to save everything you want to read for later, and access it on multiple devices and platforms. For more informations please have a look at GetPocket.com.

Pocket itself doesn’t offer a native BlackBerry 10 app. You can sideload the official android app, but that version does not integrate well with the BlackBerry 10 user interface and flow. But Pocket has a public API. ReadItNow! is probably the most popular and complete Pocket app for BlackBerry 10. It has been developed by myself over the past few years and it get’s continually updates. I’ve designed the app to be invoked by other BlackBerry 10 apps. For that reason it doesn’t need much effort at all, to integrate Pocket support for your own BlackBerry 10 app.

I’ve put together a few sniplets to show you how to integrate it with C++ and QML. It’s really easy, you will see.

Let’s start with the header file of the class, where you want to add the invocation. You should add the following lines to your header file:

In line 12 we’re defining a new function called check3rdPartyApps(). We’ll use it to detect automatically if the user has ReadItNow! installed on his device. As this check will be asynchronously, we need a slot for handling the response as well. The slot has been already defined in line 9 (onCheck3rdPartyAppsResponse()).

We’re using a InvokeQueryTargetsRequest in line 5 to search for apps that could handle “text/plain” mime type (line 6). We query the targets in line 7 and connect the finished() signal of that request with our onCheck3rdPartyAppsResponse() slot.

In our slot we iterate over all actions (line 23) and the corresponding targets (line 24). If the target name is “com.svzi.rin”, we found the app installed on that device. We need to remember that for later, so we set our class variable m_readitnowAvailable to true (line 27).

I usually call the check3rdPartyApps() in the constructor of my class, as well as every time the app got foregrounded. This way the user can start the app without having ReadItNow! installed, minimize your app, download ReadItNow! from the BlackBerry World and can use it right away, because you already checked and found it as your app got maximized again.

Now let’s share some content to ReadItNow!

There are two different ways to share content to ReadItNow:

Send an URL / URI

Send plain text, that will get parsed for any containing URLs!

For that reason we had defined two different methods in our header file (lines 2 and 3).

Before you start the invocation you should check if ReadItNow! was found on the device. If the app isn’t installed you could emit a signal, as shown in our example in line 13, to show a dialog or popup to the user and provide a link to the BlackBerry World to let him easily grab his copy of ReadItNow in order to use it with your app.

Back to the function. Lines 7 – 9 are defining the invocation request. As you can see the url parameter will be set as request URI. That’s all you need to do, to add Pocket support to your own app.

2) Send plain text, that will get parsed for any containing URLs!

But if you don’t want to share a simple URL, but a text containing one or more URLs, you need to add another function. But it doesn’t get complicated, it’s just as easy as sharing a single URL:

The only difference compared with our previous invocation is, despite the param name, the missing request.setUri(..). That call has been replaced with request.setData(…) in line 9. That’s all you need to do here as well. ReadItNow! will parse the text for any URLs and store every one of them to the users Pocket account.

What’s next?

Now you can can call either invokeReadItNowWithURL(…) or invokeReadItNowWithText(…). Whatever you want to save for later reading. You can call it from C++:

invokeReadItNowWithText("This string contains links like http://bit.ly/1VDf28P and http://blck.by/1MX2uHg ! Both will be stored to Pocket without any issues. :-)");

In my Sept blog post announcing the 10.3.1 Beta, I emphasized that one of the key objectives of the 10.3.1 release was to provide you with the APIs and tools to bring your app to BlackBerry Classic with minimal hassle. In that post I talked about some of the new APIs and shed light on some aspects of classic development. We also held a webinar a few weeks ago which some of you might have attended where we talked about the things you need to do as a developer to port your app from one of the existing BlackBerry 10 devices to the yet unreleased BlackBerry Classic. Many of you may not have had a chance to attend, which is why I want to provide a summary of the kinds of things you would need to consider as a developer when bringing your app to BlackBerry Classic. This is especially pertinent now that we have just released 10.3.1 Gold along with Momentics 2.1.1.

Getting Started

To start developing for BlackBerry Classic, the first thing you need to do is download Momentics 2.1.1 from our developer site. Once you have downloaded it you can pull in the 10.3.1 API and simulator. You will need to set your API Level to 10.3.1 in order to use the trackpad specific APIs. Since we haven’t released a BlackBerry Classic device as yet you will need to use the simulator for development and testing.

Using Design Units to Optimize for BlackBerry Classic

Once you are setup with the 10.3.1 API and tools, you can get to work on testing and porting you your app. Here are some tips on the kinds of things you should be mindful off when designing your app in order to minimize any extra work when porting to BlackBerry Classic. First you need to make sure your app is resolution agnostic. There are several things you can do to make your application scale well across multiple resolutions. When you lay out your controls, use relative layouts like stack, dock and grid in your app as opposed to absolute layouts. While relative layouts assist with the challenge of aligning controls on a screen, it does not address the issue of dealing with pixel size. This is where design units come into play. Design units are an abstraction introduced in 10.3 that allow you to specify dimensions (such as the length of a control or margin width) in a pixel independent manner. The framework converts the design units to a pixel value that’s optimal for the screen density of that device. As an example the Z10 has 10 pixels per design unit while the Z30 whose display is physically larger than the Z10 has 8 pixels per design unit.

While relative layouts and design units help in making your app resolution independent and screen density independent you will still encounter issues due to aspect ratio. For instance the BlackBerry Classic (like the Q10) has a square display while the Z10 has a rectangular display. A UI that is designed for a rectangular display will likely not look right on a square screen. To illustrate this concept I compiled and ran the Dictaphone sample on a Z10 and a BlackBerry Classic.

As you can see, the entire UI is visible on the Z10 while on the BlackBerry Classic about half the UX is cut off. You can of course access the entire UX by scrolling down on the display. However as a developer you might want to change the UX when going from a rectangular display to a square display so that you can see the entire UX without having to scroll. This is where asset selectors come into play. With asset selectors you can group a set of assets for a given display shape or size. Cascades will select the correct asset for that device. Check out this post on how to use asset selection to bring your app to a square device such as the BlackBerry Classic.

Coding for Classic Navigation Keys and Trackpad

If you follow the principles outlined above with regard to handling multiple resolutions you are already part way there in terms of bringing your app to BlackBerry Classic. The last thing you need to worry about is handling the trackpad and the navigation keys. The navigation keys are the keys to the left and right of the trackpad – the call and menu keys are to the left and the back and end keys are to the right. We provide you with the ability to receive navigation key evens as well as to customize the navigation keys. That being said, we strongly recommend not customizing the navigation keys unless you have a really good reason to do so. Our customers expect the navigation keys to function a certain way and overloading them with different functionality might be confusing and possibly evening annoying.

In contrast trackpad input and highlighting is something you may need to customize. Even though Cascades tries it’s best to provide default trackpad handling for your app, the reality is that every app is unique and the default Cascades behavior may not work for your app. Lets consider something like focus. A control gets focus when you hover over it with the trackpad. If I slide my finger downwards on the trackpad, focus moves to the next control and so on. By default when your app is launched Cascades will apply focus on the first focusable control. However this may not always make sense in the context of your app. For instance you might be writing a camera app and the “Effects”control might be highlighted by default when the app starts up. However you might want the “take picture” control to be highlighted instead. Cascades provides the facility to apply focus to a different control at app launch – you can do this by setting the locallyfocused property to true. You can configure this by checking the locallyfocused checkbox via the QML Properties view in Momentics or by making the edits directly in your qml source file.

One thing to keep in mind is that not all Cascades controls get focus by default. These include containers, labels, and images. This is because these are read only controls for which a focus paradigm does not make sense. The one exception is when these controls are added as list items – in this scenario they will be highlighted when that list item is selected. Either way irrespective of whether a control can or cannot get highlighted, you can override this behavior in Cascades by setting navigation.focusPolicy to Focusable or NotFocusable.

The other cool thing you can do in your app is change the trackpad navigation path. The following section in our developer docs illustrates how this can be done. If you decide to change the navigation path, make sure that you do this in such a way that it makes logical sense for the end user. The last thing you want is for the focus to move around unexpectedly and in an unpredictable manner.

Our support for trackpad goes beyond just enabling focus and changing focus path. Cascades also provides the ability to add custom highlighting to your control when it gets focus. In many cases you might be faced with a situation where the default highlighting on a control doesn’t look right. For instance the colour of your control might not mix well with the highlight colour resulting in a visually jarring experience. We provide several mechanisms for addressing this such as changing background colours, changing the highlight property or adding an effect .

Implications on Core Native

So far I have spoken a fair bit about Cascades but haven’t really touched on core native developers who might have existing content to port over and want access to trackpad events. Trackpad functionality is also available in core native via libScreen. The input from the trackpad comes in as a JOYSTICK screen event. Joystick events include both the displacement and the position of the joystick. Joystick events also work on the simulator so you can try it out to get a sense of how it works. We don’t provide access to built in UX controls at the core native layer so things like custom highlighting and focus do not really apply. If you do happen to have a core native app that supports a custom UX and need to support highlighting or focus, you would need to implement these features yourself. We also support the ability to intercept navigation key events at the BPS layer. The menu key can be intercepted as a screen event and the rest of the buttons can be intercepted via the navigator module.

As a developer I find that the best way I learn is by looking at actual code samples. This way I can compile a sample, try it on the simulator and play around with the code. We have several samples that highlight some of the topics I’ve covered here. You can find them at https://developer.blackberry.com/native/sampleapps. Two samples that I would like to call out specifically are the Belt sample and Highlighter. The Belt sample demonstrates how to intercept and respond to trackpad and navigation key presses while Highlighter sample demonstrates how to include and customize highlighting in your app.

Wrap-Up

In this post, I have tried to provide a high level map of the things you need to consider when porting your app over to BlackBerry Classic. It should be seen a starting point as opposed to a full blown tutorial. I have tried to point out the main challenges you might encounter and how you can address them and some useful links you can access for further reading. At the end of the day every app is different – for some, your app might port over with minimal effort. This would be especially true if you have an app that already works well on our existing rectangular and square displays and uses no custom controls. Those of you writing more complicated apps with custom controls might encounter more challenges. Either way, I hope you have found this article helpful and hope to see your app in BlackBerry World at launch!

When mobilizing a company, there will be challenges to gain access to platforms, data and processes, that are siloed of in monolithic stacks and session based transports. With the connectivity and bandwidth challenges of mobility, it’s hard to build upon the traditional Enterprise Technology stacks. Mobility uses high volume, high transactional, non-session based transactions and requires a different approach.

A new paradigm

Mobility changes how we use IT services and solutions. With its 24/7 always on nature, it creates new windows of opportunities and possibilities, but it also comes with challenges for the existing Enterprise Architecture in many larger companies. Traditional Enterprise Architecture is based on high bandwidth, low transactions, session-based communications. Mobility does not have that luxury; a device with a mobile connection has limited bandwidth and doesn’t always have connectivity.

To mitigate these challenges, mobility uses non-session based, high volume transactional, small bits of communications, to reduce the overhead of dropped sessions and ensure responsiveness in communication and the actual application usage on the devices.

In mobility almost everyone is standardizing on RESTfull web API’s/ web services to provide that type of communication for mobility.

Building Bridges

Trying to pry everything out of the existing systems and build a complete new Architecture takes time and is a gradual process; while mobile needs are rising now, as they are the key for many companies to differentiate themselves, increase productivity and efficiency.

So to be able to move forward, bridges need to be built.

One of those bridges is provided by NodeJS. NodeJS is the standalone JavaScript run-time engine that also powers Google’s Chrome browser. NodeJS is great for mobile when using HTML5 as the platform to build your Enterprise Application with. You can have both JavaScript on the Server and in the Client, use the same objects and data bindings, allowing much reuse of code on both client and server.

Additionally NodeJS provides exactly the right communication profile based on http(s) for mobile and allows both great horizontal and vertical scaling, allowing for extreme high volume of transactions.

To top it off there are over 77,000 modules available for NodeJS that help to connect to your existing Enterprise Systems; Oracle, MS SQL, SAP to LDAP, Active Directory, Sharepoint and many, many others.

Crossing the bridge

Leveraging the BlackBerry Enterprise Service 10 for connectivity and security, you can use the Github sample LDAP Search.
The Sample shows how to setup and configure a NodeJS server that provides a small Web API, to do LDAP searches against your own LDAP directory (for example your corporate Active Directory), to find your colleagues.

]]>BridgereumerdBridgeFrameworks, JavaScript and C++ … oh my! BlackBerry Jam Americas Session Previewhttp://devblog.blackberry.com/2013/05/frameworks-javascript-and-c-oh-my-blackberry-jam-americas-session-preview/
Fri, 10 May 2013 17:59:47 +0000http://devblog.blackberry.com/?p=14958/ Read More]]>I look forward to seeing many of you in Orlando May 14-16 for BlackBerry Jam Americas. You’ll find me wandering around & presenting, coding, hacking and helping developers find new and interesting ways to build amazing applications for BlackBerry 10. In fact, I’m quite excited to present the following two sessions which are directed at the HTML5 & WebWorks development communities:

Ask any Web developer how many JavaScript frameworks there are out there and you’ll likely end up waiting a long time as they answer. There are so many to choose from and new ones appear in the wild on a daily basis: UI frameworks, libraries, shims & polyfills, animation, graphs, gestures, MVC, performance, etc. We developers who solve difficult coding problems are eager to share their solutions in the form of JavaScript frameworks, allowing others to also build compelling application content. In this session, I’m going to share a few of my own personal favorite frameworks that are focused on improving the quality of your HTML5 applications or games. I even plan on doing a live coding demo of an HTML5 gaming framework. Wish me luck!

Okay folks, I’m really excited about this one. This session is actually a 2 hour lab that will empower developers to boost the quality of their HTML5-powered WebWorks applications and take them to the next level of awesomeness. Developers – have you ever built a Web app using technologies like HTML5, CSS or JavaScript and encountered a situation where the feature you wanted to implement could not be added because it was not defined in any Web standards? Some examples include: blinking the LED light, sending a message via Bluetooth or keeping the device backlight on (none of these are features that can be added using standard JavaScript). The BlackBerry 10 OS has a powerful native API platform that can be leveraged in a WebWorks application by exposing native code to the JavaScript engine via custom Third Party extensions. During this lab, attendees will not only learn how to build WebWorks extensions for BlackBerry 10, but they will actually create their own! By the time this lab is over, everyone will have a functional WebWorks application running on their free BlackBerry Z10 smartphone that makes use of a native extension. It’s going to get crazy in there.

]]>adamstan1TITLE_IMAGEBlackBerry Jam Unplugged: BBM APIshttp://devblog.blackberry.com/2013/05/blackberry-jam-unplugged-bbm-apis/
Thu, 02 May 2013 14:41:47 +0000http://devblog.blackberry.com/?p=14802/ Read More]]>Hot off the press is the latest episode of the BlackBerry Jam Unplugged series where we learn a little more about BBM integration with BlackBerry 10.

We’ll be posting videos as part of this series leading up to BlackBerry Jam Americas in Orlando in order to give some more background surrounding the topics that we’ll be discussing in detail during the conference.

This particular video will give you some information about the upcoming roadmap items that we’re looking at for extending BBM capabilities for developers. In this video we’re joined by Nick Kalkounis to talk about new APIs that are coming to better connect your application through BBM.

Next week isn’t just CES in Las Vegas; it’s also the 2013 AT&T Developer Summit – and the BlackBerry Developer Relations team will be there in full force.

Our own Larry McDonough will be presenting “Building Applications for Launch of the New BlackBerry 10 Platform” on Monday, January 7th, 2013 from 2:00 PM – 2:45 PM. On the same day, our good friend Andrew Poliak from the QNX Auto Team will be a panelist on “Navigating the Connected Vehicle Vision” from 3:00 PM – 3:45 PM.

That’s not all – we’ve also got an exciting BlackBerry 10 live porting challenge during the hackathon portion of the summit:

“Be part of open source history and participate in the AT&T API for BlackBerry 10 “Live Port” challenge! Using the iOS version of the AT&T API as reference, complete the port and build the best BlackBerry 10 app leveraging the AT&T API and be eligible for prizes including a trip to BlackBerry Jam Europe in Amsterdam! There will be plenty of help onsite to help with any question you may have. Are you up to the challenge?”