October 24, 2013

Integrate With Line of Business Apps Using KidoZen

By

The smart device revolution has the promise to completely transform business processes as mobile workers no longer need to lug around a 9 pound laptop, and deal with separate wireless data cards, USB dongles, VPN fobs and standalone Wifi hotspots.  With BYOD, mobile users are driving huge demand for their employers to deliver internal company apps to their mobile devices.  To truly capitalize on enterprise mobility, development teams need fast and easy way to deliver secure, integrated apps for iOS and Android.

-_KidoZen-3Fortunately, the new the KidoZen SDK component can help. KidoZen offers the standard set of services offered by a “mobile backend as a service” provider: a document datastore, authentication and authorization, push notifications, queuing, and logging. They also add some nice touches, like an API for sending text messages. However, their big differentiator is their Enterprise API feature. This lets you integrate with supported enterprise line-of-business applications, such as Dynamics CRM, SharePoint Online, Salesforce, SugarCRM, Exchange, and more. They provide the tooling and documentation that allow you to create custom adapters for your own enterprise applications. Let’s look at how you use these adapters in your code.

Kidozen Application Architecture.

You’ll need to register for an account to get started. Once done, you’ll then create your application in their dashboard. You’ll supply those details in your app’s startup code. Here’s an example using a demo account that’s been setup by KidoZen:

var app = new KZApplication("https://demo11.kidocloud.com/","tasky"); // Note: It's still called KZApplication even on Android.
await app.Initialize();
// Present the login UI, then supply results to the Authenticate method.
// For the demo account, use "demo11@kidozen.com", "demo1234", and "Kidozen"
var user = await app.Authenticate(userName, userPassword, userSource);
// If unsuccessful, re-present the user with the login UI.
// Otherwise, continue on with your amazing app!
var tasks = app.Storage["tasks"];
var queryResult = await tasks.Query("{}");
if (!queryResult.Succeed) return;
// Send an SMS to someone.
var sms = app.SmsSender["+15554131212"];
sms.Send(String.Format("You have {0} tasks assigned to you.", queryResult.Data.Count()));

Easy, straightforward. So let’s skip ahead to see how we access Enterprise line-of-business data. In this case, we’ll get some information from Sharepoint Online using the KidoZen adapter.

// Gets a reference to the service
var sharepoint = app.Service["sharepoint"];
// Authenticates a user
var authResult = await sharepoint.Invoke("authenticate", new { username="foo", password="bar" });
// Gets Calendar list using OData query.
var queryOptions = new {
    auth   = authResult.Data.Value("auth"),
    filter = "Title eq 'Calendar'"
};
var result = await sharepoint.Invoke("queryLists", queryOptions);
// Display results.

There you have it: straightforward integration of line-of-business data with your Xamarin app. While we accessed a cloud service in this case, KidoZen provides the ability to expose applications hosted in your private cloud via the .Services dictionary. Combined with a custom adapter, this is a powerful tool for building enterprise applications.

TwitterFacebookGoogle+LinkedInEmail