Pluralsight blog Where devs, IT admins & creative pros go for news, tips, videos and more.
Pluralsight + Digital-Tutors - 3,000 tech & creative courses - starting at $29/month Get it now →
April 16, 2012

Meet the Author: Yacine Khammal on Building Windows Phone Applications with Azure


In the latest installment of our Meet the Author podcast, Fritz Onion speaks to Yacine Khammal about his course on Building Windows Phone Applications with Azure.  In the interview Yacine explains why mobile developers would want to leverage the Azure services.  He also describes the three basic data services and their use in a mobile application environment as well as how to use the Azure SDK library to ease integration with the Azure services.

Listen to the Audio (MP3)

Meet the Author:  Yacine Khammal on Building Windows Phone Applications with Azure


[Fritz]  Hi. This is Fritz Onion with another episode of Pluralsight’s Meet the Author podcasts. Today I’m speaking with Yacine Khammal about his new course, Building Windows Phone Applications With Azure. Yacine has been involved in the development of database driven n-tier Web applications for over a decade. Over time he’s taken on various roles including development, project management, offshore platform management, and technical consulting. He’s also helped build a few solutions for Microsoft North Africa, and he’s coming to us from Morocco today. Hi, Yacine. It’s good to talk with you.

[Yacine]  Hi, Fritz. Nice talking to you too.

[Fritz]  So in your new course, Yacine, this course on Windows Phone and Azure, you cover working with Windows Phone and using Azure as sort of your storage mechanism, at least the part that I was looking at. And I know you go into working with Azure tables, with blobs, and queues. Now, the course title, Windows Phone and Azure, what’s so important about combining these two technologies?

[Yacine]  Well, Fritz, the cloud is a natural complement and even an extension to mobile applications, and the Windows Phone platform was actually built with such cloud scenarios in mind from the — from the onset. For one thing, to be of any value nowadays, the phone application that we build typically need to access cloud services such as email, identity, social services, location maps, data feeds, and so on. So push notification is another example of fundamental cloud services that phone device applications need to — need to access and typically can’t do without. The other thing that in this action to accessing external services is another fundamental role that the cloud plays is to provide processing to make up for the limited processing and storage resourses that are available on the phone. So the Azure platform makes up for that relative shortage through an unlimited and elastic virtual machine power and storage capacity. And so these resources which are not — these resources are not affected by battery life either. So when you combine a rich phone application with such cloud power, you open up a huge breadth of new possibilities and scenarios. For example, you can use the cloud as back-end to store large user data from a phone, such as large media files. We can mash social services into a single consolidated service. That’s the phone application we’ll talk to or run complex calculation in the background from our phone app and so on. So it’s quite evident that phone plus cloud is a compelling partnership.

[Fritz]  Yeah. And we see this more and more today in many different platforms, right? I mean, the iPhone has Siri that uses server-side processing for voice recognition, and the Kindle, the Kindle Fire does server-side processing in their Web browser. I think it’s — we’re going to start seeing more and more of this with these lightweight devices and heavy elastic back-ends. So, yeah. It sounds like a great combination. What sort of challenges do you run into when you try to leverage Windows Azure within a Windows Phone application?

[Yacine]  Well, it takes quite a bit of work to carry out operations in Azure from a phone application. The managed library that’s available in the Azure SDK is not available for the phone which as you know runs from — runs a modified version of Silverlight. So that means that you need to work directly over HTTP using the public APIs that are exposed by the various Azure services. For example, storage services. So in your application you actually need to manually handle all the details of building the calls, for example, the REST calls to the table or blob service or to communicate with the Azure access control service or the Microsoft push notification service. So that’s nontrivial and it’s time-consuming. And the other main challenge when working with Azure is handling the security aspects, namely, authentication and authorization which usually require you to understand a significant amount of lower level protocols and details. Also, if you want to access the cloud from your phone application, you usually need to store sensitive cloud access keys on the phone. But, as you know, a device can easily get lost or stolen. So this can cause a security threat, security risk that you need to take into account. Now, the good news is there’s a great toolkit that is available on Codeplex the so-called Windows Azure toolkit for Windows Phone that handles much of this work and actually hides a lot of lower-level details from us. So, for one thing, it wraps all the HTTP calls in a storage client library similar to the Azure SDK library which allows us to perform these cloud operations using .NET abstractions and along the way provides a security infrastructure that solves some of the shortcomings that I’ve mentioned. So we actually devote a significant part of the course to exploring that toolkit and how to use it for building our cloud-based mobile scenarios.

[Fritz]  Great. Now, Azure is a pretty big subject. I mean, they have the instances you can run in the cloud. They have the large storage system. What exactly do you focus on in this course when you’re working with Windows Phone?

[Yacine]  Well, this course focuses on the Windows — Windows Azure storage part. So there’ll be a follow-up course that will cover other aspects such as push notifications, access control services, and so on. But this one focuses basically on accessing tables, blobs, and queue services. So there’s a module that’s devoted to each of these three storage types. And in each module I go over the fundamentals of what the storage type is. So the blobs, the tables, the queues, what they are and how they work; what they’re used for; and what that REST — the REST API that is exposed in the cloud looks like. And then we go into the managed API that is made available in the toolkit for that specific storage type. A lot of the challenges of working with the Azure storage services come from access control. So we start by learning about the Azure authentication schemes for each storage type. So — and then we examine the way that the toolkit implements these schemes internally. And we dig into the toolkit’s architecture and infrastructure to try to get a conceptual grasp of the toolkit’s authentication and authorization flows that later makes it easy to interact with storage services. And then we walk through some of the code to really understand what’s happening under the covers and how things are implemented. And we roll up our sleeves and we build our own applications to test it out. So that is basically when the tire hits the road.

[Fritz]  So could you give us a sense, perhaps, of when you might choose tables versus blobs versus queues and what the difference is in interacting with each of those storage entities in Azure?

[Yacine]  Well, tables, tables are probably the easiest concept to grasp since tables are basically azure’s NOSQL offering which provides highly efficient and scalable storage capable of handling massive amounts of entities that are composed of key value pairs of primitive types. Blobs are for storing binary data such as document files, images, audio or video content. And queues are probably the weirdest beast of all, and they’re used to store short messages, again, in a highly efficient and scalable way; and they’re typically used for asynchronous messaging scenarios. In our module on queues, we look at a common scenario that involves an Azure worker role that performs some back-end processing on behalf of the phone client. And in this scenario the phone application queues up some recross into an Azure queue, and the worker role feeds of that queue to retrieve work titles perform. So the queue acts as a work backlog that the various components can access. And another common scenario is for a front-end Web role to queue up some work for the worker role to perform. But such scenario is not specific to mobile applications. In the course we look at examples of this type of design in the context of mobile scenarios. And along the way we’ll discuss a couple of important features of queues such as message durability, which are important to making cloud applications robust.

[Fritz]  Great. So, to wrap up, could you give us an idea of who this course is targeted at, you know, what sort of background they should have, and what they should hope to take away after watching the course?

[Yacine]  Yes. The course is for Windows Phone developers who want to get started with Azure. So, basically, we assume that you’re already at least somewhat familiar with the Windows Phone platform. That’s with the phone application life cycle, with XAML, with asynchronous service calls, and that maybe you have some notion of MVVM, which is used in the toolkit. However, we don’t assume any particular knowledge of Windows Azure. We start each module with a review of the key concepts we need moving forward. So if you’re a phone developer or maybe a SilverLight developers who dabble with the phone and you want to extend your applications into the cloud, then this course is for you.

[Fritz]  Great. Well, thanks very much, Yacine. That’s Yacine Khammal with his new course, Building Windows Phone Applications with Azure. Thanks for taking the time, Yacine.

[Yacine]  Thank you, Fritz.

About the Author

is a Chief Architect specializing in large scale distributed system development and enterprise software processes. Paul has more than twenty years of development experience including being a former Microsoft MVP, a speaker at technical conferences such as Microsoft Tech-Ed and VSLive, and a published author. Prior to working on the Windows platform, he built software using a vast array of technologies including Java, Unix, C, and even OS/2.