Core App Invocation in the Enterprise Workspace

Welcome Enterprise Developer Citizens! Chances are, if you’re reading this, you’re looking to build a BlackBerry 10 application in the workspace of your BlackBerry Enterprise Server-connected BlackBerry 10 devices. Although you’re going to be building your own customapplications, you should be aware of existing core applications available to you as a developer for integration into your solution.

This blog post is to provide some tips on how you can leverage the Invocation Framework to tie into those existing core apps, giving you the ability to build an even more compelling enterprise solution. It’s really simple math:

Let’s start by talking about some of the core apps available to you.

BlackBerry Enterprise Instant Messaging (EIM)

Many organizations have existing instant messenger clients leveraged by their workforce. These solutions are behind the firewall and have desktop clients. The BlackBerry Enterprise IM app provides your BlackBerry 10 device with access to your organization’s instant messenger client so you can chat with colleagues using your organization’s IM system. EIM is designed for use with Microsoft Office Communicator, Microsoft Lync and IBM Sametime. The BlackBerry device itself has to be connected to your organization’s BlackBerry Enterprise Server in order for EIM to work. As a developer, you can tie into this powerful app from your custom solution to perform tasks such as initiating chats. This would be done using the following invocation framework:

Create an InvokeManager object, to manage interaction with the invocation service

1

<b>InvokeManager</b><b>invokeManager;</b>

Create an InvokeRequest object, to encapsulate the details of the request to be passed to EIM.

We’re sending the invocation request to the invocation framework targeting EIM. A reply message indicating the success of the request is passed to the *reply pointer. You should build code to handle that reply

Adobe Reader

Create a signature and place it on any PDF file right on your BlackBerry 10 device

Easily share files through a variety of channels (such as email and NFC)

As a developer, you could have the requirement of building a BlackBerry app that allows interaction with PDF files, so it only makes sense to integrate with the existing Adobe Reader application from your custom app. In our code snippet, we’ll show how simple it is to invoke the Adobe Reader app as a card and display a pdf file:

*Implement InvokeManager &InvokeRequest as discussed in first code sample

I reference a pdf file stored on the device, in this case included in the application directory

We’re sending the invocation request to the invocation framework targeting Adobe Reader. A reply message indicating the success of the request is passed to the *reply pointer. You should build code to handle that reply

Upon successful execution of this code, the pdf file will be launched in a previewer card. Upon exit of the previewer card, you’ll be returned to your app.

BlackBerry Browser

It’s common for a user to need to launch a browser as part of their regular usage of their BlackBerry device, but what if that could be done without the user having to leave your app to do so? Leveraging the invocation framework, the BlackBerry browser can be called from within your application. Since your app will reside in the workspace, the work browser will be launched and can be pointed to URLS of internally intranet hosted resources. The app can also open local content (htm, html, xhtml, svg) from within the BlackBerry browser. Our code sample will focus on launching a website:

*Implement InvokeManager &InvokeRequest as discussed in first code sample

We’re sending the invocation request to the invocation framework targeting the Browser. A reply message indicating the success of the request is passed to the *reply pointer. You should build code to handle that reply

We’re sending the invocation request to the invocation framework targeting the Phone app4. A reply message indicating the success of the request is passed to the *reply pointer. You should build code to handle that reply

Upon successful execution of this code, a message box is displayed asking the user if they’d like to make a call to the pre-designated number. If the user clicks OK, the call is made.

Hopefully this blog posting has provided you with a few helpful tips to get you going with building solutions that include the already existing core applications. A sample app has been created and posted here demonstrating the above code so feel free to use as needed. Follow me on Twitter and post any questions and comments you have in the section below.

Disclaimer: SDKNews.com only syndicates the blog entries from various SDK blogs.
We are not the creator/author of these entries (posts). Product names, brand names
and company names mentioned on this site may be trademarks of their respective owners.