Microsoft Platform and Tools for Mobile App Development

Cesar de la Torre
Simon Calvert

PUBLISHED BY
Microsoft Press
A division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399

Copyright © 2016 by Microsoft Corporation

All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher.

ISBN: 978-1-5093-0413-4

Microsoft Press books are available through booksellers and distributors worldwide. If you need support related to this book, email Microsoft Press Support at mspinput@microsoft.com. Please tell us what you think of this book at http://aka.ms/tellpress.

This book is provided “as-is” and expresses the author’s views and opinions. The views, opinions and information expressed in this book, including URL and other Internet website references, may change without notice.

Some examples depicted herein are provided for illustration only and are fictitious. No real association or connection is intended or should be inferred.

Microsoft and the trademarks listed at http://www.microsoft.com on the “Trademarks” webpage are trademarks of the Microsoft group of companies. All other marks are property of their respective owners.

Acquisitions Editor: Devon Musgrave
Editorial Production: Dianne Russell, Octal Publishing, Inc.
Copyeditor: Bob Russell, Octal Publishing, Inc.

Contents

Introduction

Who should read this book

Assumptions

This book might not be for you if...

Organization of this book

Finding your best starting point in this book

Acknowlegments

Errata, updates, & book support

Free ebooks from Microsoft Press

We want to hear from you

Stay in touch

Chapter 1: Introduction to the Microsoft platform for mobile app development

Chapter 2: Developing client mobile apps

Choices for cross-platform mobile development

Building hybrid mobile apps based on HTML/JavaScript

Using Visual Studio Tools for Apache Cordova

Building native and cross-platform apps

Using C#, .NET, and Xamarin in Visual Studio and Xamarin Studio

Building native components by using Visual Studio C++ cross-platform

Building native games by using Visual Studio Tools for Unity

Creating custom LoB apps quickly by using Microsoft PowerApps

Chapter 3: Developing back-end services

Mobile back ends using Azure App Service

Mobile back-end services with Azure Mobile Apps

Workflow and business processes with Azure App Service Logic Apps

Building microservices with Azure Service Fabric

Azure Service Fabric

Implementing data platform services by using Azure

SQL databases using Azure SQL Database

NoSQL databases using Azure DocumentDB

Storage via Azure Storage

Caching by using Azure Redis Cache

On-premises back-end systems via Azure Stack

On-premises services for mobile apps: Azure Stack App Service

Back-end platform for Internet of Things with Microsoft Azure

Chapter 4: DevOps for mobile

Managing teams and projects by using VSTS/TFS

Continuous integration, deployment, and release management using VSTS/TFS, Xamarin Test Cloud, and HockeyApp

Managing a beta release program by using HockeyApp

Gathering operational and behavioral analytics by using HockeyApp

Getting mobile customer insights and implementing marketing campaigns by using Azure Mobile Engagement

Real-time actionable analytics to maximize return on investment

Value-added push and communications platform

Open APIs and ease of integration

DevOps for back-end mobile services using VSTS, Azure, and Application Insights

Analyzing the health of back-end services by using Visual Studio Application Insights

Chapter 5: Securing and managing mobile apps

Securing mobile apps

Identity, SSO, authentication, and authorization

Communication security

Threats analysis

Data protection on device (data at rest)

Managing client mobile apps and devices

Securing mobile apps end to end with Microsoft Intune MAM

Chapter 6: Conclusions

Key takeaways

Appendix: Technology decision tables

Mobile app development technologies

Hybrid and cross-platform: Visual Studio Tools for Apache Cordova

Native and cross-platform: C#—Visual Studio with .NET and Xamarin

Rapid Mobile App Development (RMAD) with Microsoft PowerApps

Back-end and cloud services technologies

PaaS and MBaaS

PaaS: Microservices and hyperscale

Service development technologies

Data platform in Azure for mobile apps

DevOps for mobile: Tools and SDKs

Development team collaboration services and tools

Technologies for securing mobile apps

Identity, SSO, and authentication

Authentication client SDKs for mobile apps

Managing and securing mobile apps and devices

Other security products

Introduction

Understanding and creating a mobile app development strategy is an important process for today’s development decision-makers who aim to open up new business opportunities or to empower employees to be more productive with new capabilities.

Microsoft defines an end-to-end (E2E) platform for the agile creation of mobile apps that can target any platform (iOS, Android, or Windows), provides easy consumption of services in the cloud or on-premises, spans the requirements for consumer or employee scenarios, offers development teams DevOps tools to improve quality and to achieve faster time to market, and allows for integration with existing enterprise systems.

This book outlines the E2E platform from Microsoft that forms the critical capabilities for organizations selecting technologies and tools for a Mobile Application Development Platform (MADP) and Rapid Mobile Application Development (RMAD). It also describes the core decision factors that organizations should consider, and it outlines the technical capabilities available within Microsoft solutions and products.

Who should read this book

Technical decision-makers and developer leads who require a high-level overview and advice on when to use Microsoft solutions and technologies for building mobile apps can benefit from this content.

Assumptions

This book expects that you have at least a minimal development background as well as Software Development Lifecycle (SDLC) insights, although it does not require deep technical development skills, because the scope is broad and from a high level technical point of view.

This book might not be for you if...

This book might not be for you if you are an advanced developer in Microsoft technologies with skills in most mobile development areas from Microsoft or if you are expecting to learn implementation details on the technologies covered in the book.

Organization of this book

This book is divided into six chapters, four of them defining the four main pillars of the mobile applications development platform. Each of those four main chapters focuses on a different pillar or big area related to the E2E mobile application development process. Chapter 1, “Introduction to the Microsoft platform for mobile app development,” provides a quick overview of Microsoft’s E2E vision for mobile apps development. Chapter 2, “Developing client mobile apps,” starts drilling down on the client apps development covering several approaches (native versus hybrid) and related technologies like Xamarin and Apache Cordova. Chapter 3, “Developing back-end services,” continues with the server side of the house, or how you can create services in the cloud or on-premises that make it easier to create mobile apps. Chapter 4, “DevOps for mobile,” introduces SDLC and automated development processes and aspects that are specific and different for mobile. Chapter 5, “Securing and managing mobile apps,” tackles technologies and products from Microsoft that you can use when securing mobile apps, plus Mobile Apps Management (MAM), or how you can apply enterprise policies to business to employee apps in the enterprise.

The appendix, “Technology decision tables,” provides further insights on every pillar by enumerating most technologies and subtechnologies and advising when you should or should not use them.

Finding your best starting point in this book

The different chapters of this book cover a wide range of technologies associated with mobile application development platform. Depending on your needs and your existing understanding of Microsoft platform and tools for mobile, you might want to focus on specific areas of the book. Use the following table to determine how best to proceed through the book.

Acknowledgments

I’d like to thank all the contributors from the different product groups in Microsoft (VS, VSTS, Xamarin, Cordova, Azure, PowerApps, HockeyApp, Intune). Without their reviews, confirmations, and insights, an end-to-end ebook like this would not have been possible, given that it is covering so many different products from many teams.

Special thanks go out to Amanda Silver and Simon Calvert for their support. They always recognized the importance of an E2E MADP (Mobile Application Development Platform) vision and strategy from Microsoft. They are the ones who sowed the original “seeds” for this MADP story.

Additional contributors to this ebook include Chuck Lantz, principal PM, Visual Studio team; Jonathan Carter, principal PM, Visual Studio team; Sam Tulimat, PM, Intune team; Ryan Cunningham, principal PM, Azure PowerApps team; Jeffrey Shomper, senior product manager, Azure team; Scott Wylie, director, Azure marketing team; Joshua Weber, senior PM, HockeyApp team; Ricardo Minguez, senior PM, Visual Studio team; Christina Compy, principal PM, Azure Stack team. My thanks to you all!

Errata, updates, & book support

We’ve made every effort to ensure the accuracy of this book and its companion content. You can access updates to this book—in the form of a list of submitted errata and their related corrections—at:

http://aka.ms/MobileAppDev/errata

If you discover an error that is not already listed, please submit it to us at the same page.

If you need additional support, email Microsoft Press Book Support at mspinput@microsoft.com.

Please note that product support for Microsoft software and hardware is not offered through the previous addresses. For help with Microsoft software or hardware, go to http://support.microsoft.com.

Free ebooks from Microsoft Press

From technical overviews to in-depth information on special topics, the free ebooks from Microsoft Press cover a wide range of topics. These ebooks are available in PDF, EPUB, and Mobi for Kindle formats, ready for you to download at:

http://aka.ms/mspressfree

Check back often to see what is new!

We want to hear from you

At Microsoft Press, your satisfaction is our top priority, and your feedback our most valuable asset. Please tell us what you think of this book at:

http://aka.ms/tellpress

We know you’re busy, so we’ve kept it short with just a few questions. Your answers go directly to the editors at Microsoft Press. (No personal information will be requested.) Thanks in advance for your input!

Stay in touch

Let’s keep the conversation going! We’re on Twitter: http://twitter.com/MicrosoftPress

Chapter 1. Introduction to the Microsoft platform for mobile app development

Vision: Create an adaptable, enterprise-grade mobile app strategy that spans your development, IT operations, and production management.

Building a mobile app development strategy to drive new business opportunities or to empower productive employees entails many decisions. More than simply selecting a programming language, it means deciding whether to invest and build apps for iOS, Android, or Windows with single-platform languages/SDKs or to adopt a cross-platform approach. It means building a strategy that makes it possible for the organization to adapt as the platforms and devices evolve—a strategy that delivers mobile back-end services that can scale. And, it means that apps are secure if the device is lost or if you need to restrict users or capabilities of the app. It even means integrating seamlessly with back-end data, whether online or offline.

Decision-makers want a flexible, secure, and enterprise-grade strategy that can evolve with their business. Enterprise developers want to take advantage of and expand on their skills—whether those skills are in web/JavaScript, .NET/C#, or C++ and existing code base. And they want to be able to connect to back-end systems, either in the cloud or on-premises, and deliver continuously and quickly—as required by the business. IT wants to have confidence in its secure management of apps and devices, and marketing wants to drive effective, mobile, and targeted campaigns.

Clearly, it is not just about developing client mobile apps, which is only the tip of the iceberg. Figure 1-1 shows that there are many other areas to take into account, like back-end services development and a full mobile app lifecycle. These are all made possible through Microsoft tools and services.

Figure 1-1: The main pillars in the Microsoft platform for mobile app development

An organization might see its mobile client app strategy fulfilled by investments in websites, simple client apps made up of web content, or in feature-rich client mobile apps that make use of many of the capabilities of the device. Indeed, many organizations take a multichannel approach to their business needs by investing in multiple approaches in a complementary manner.

A mobile web presence provides a broad approach that has a simple update process across all form factors. It is, however, limited when thinking about device capabilities (such as the ability to interact with a barcode scanner) and therefore less capable of engaging these capabilities or of promoting employee productivity scenarios. Mobile client apps, on the other hand, which are distributed via stores, have full device capabilities and engaged experiences but require compilation and packaging for each target platform (iOS, Android, or Windows).

Selecting to go web or mobile client app (or to choose some combination of them) involves decisions that range from an architectural point of view to considerations of cost, quality, and time to market (and can vary from project to project). In today’s fast-moving world, it is not just about the construction of apps; it’s also about how productive the development teams are, how well they can adjust to feedback and fix issues, how IT manages apps and devices in the modern “bring your own device” (BYOD) environment, and how well marketing can engage with its audiences. Decision factors might therefore include the following:

• The existing skills or ability of a developer or team, along with costs to retool and retrain.

• The types of apps to be built and their business objective, such as Business to Employee (B2E), Business to Business (B2B), or Business to Consumer (B2C).

• Technological requirements, such as device capabilities, security, existing enterprise systems, new capabilities (like push notifications, beacons, or analytics to drive app health), user telemetry, or marketing and engagement campaigns.

• Community and product support capabilities, including integration with existing tools and processes.

• The time-to-market, quality, and adherence to the look and feel or user experience (UX) of the desired platforms.

• Costs, skills, time, and ability to drive an agile, quality-focused development process from staging, to beta, to production—the software development lifecycle (SDLC).

• Secure mobile client app delivery, management, or device management requirements.

Figure 1-2 distributes specific Microsoft technologies and tools per each of the mentioned pillars. Microsoft tools provide a multichannel approach (useful for web and mobile) so that you can take advantage of existing skills, connect to back-end systems on-premises or in the cloud, and improve teamwork collaboration between developer teams and IT operations.

Figure 1-2: Products and technologies in the Microsoft platform for mobile app development

The Microsoft platform for mobile app development has the following components:

• Apps development Developers can use client-side technologies to build client apps themselves, using specific frameworks and patterns for a cross-platform approach. With Microsoft technologies, developers can build native (native-single-platform using languages like Objective-C and Java with Microsoft Azure SDKs, native and cross-platform apps using Xamarin, .NET and C#), hybrid (using Cordova and its variants), or websites (ASP.NET), depending upon their decision factors.

Professional developers building client front ends can make use of integrated development environments (IDEs) and code editors such as Microsoft Visual Studio, Xamarin Studio, or Visual Studio Code on PCs and Macs to construct their client apps. These tools offer a Rapid Application Development (RAD) approach to building client mobile apps with designers, IntelliSense, and other productivity features, such as cross-platform debugging. In addition, a no-code, visual RAD tool, called Microsoft PowerApps, makes it possible for users to build codeless mobile enterprise apps quickly and easily with connections to their back-end enterprise systems.

• Back-end services development Azure App Service, Azure Service Fabric, and Azure IaaS virtual machines (VMs) provide the foundation from Mobile Back End as a Service (MBaaS) to PaaS and laaS, depending upon levels of customization, scale, and coding. Developers can create APIs backed by connectors to enterprise systems, SaaS, and ERP/CRM systems. Developers use mobile services, such as push notification, data sync online/offline, and authentication, and a data platform, which together form a comprehensive and expansive MBaaS that supports a variety of app construction scenarios. Developers who want to implement a microservices architecture can use Azure Service Fabric (PaaS) to produce composeable APIs for scale and performance. This all runs on Azure cloud and on-premises with Azure Stack.

• DevOps and app analytics Developers creating mobile back ends and client front ends can use Visual Studio Team Services (online) or Team Foundation Server (on-premises) to build out a comprehensive application lifecycle management (ALM) or Agile team environment—from source-code control and bug tracking to scrum workload tracking.

Developers can create mobile and cloud-focused DevOps for a fast, iterative process that covers continuous integration (CI) delivery, continuous delivery (CD), and release management (RM). Developers can produce native builds for all platforms and can run unit tests and UI automation—including against emulators or real devices in the cloud—using Xamarin Test Cloud or partners, such as Perfecto Mobile or Sauce Labs. Developers also can automate their back-end code releases in Azure staging slots, from development to staging and production.

Developers creating comprehensive build tasks can automate their releases through to beta test channels, such as HockeyApp, or deploy directly to enterprise stores or app stores or to enterprise management products such as Intune.

Using HockeyApp, developers can easily distribute and gather exception telemetry from their apps. As part of the beta process, HockeyApp gives developers the means to easily distribute their beta versions to an internal or external audience. Additionally, by making use of HockeyApp SDKs, developers can monitor and respond to issues in their apps through crash reports.

• End-user insights and business analytics Azure Mobile Engagement provides insights on users and how they are using the app, along with a way to segment users and to create targeted marketing campaigns based on push notifications sent to mobile devices.

• IT management and security Developers using Active Directory (AD) can produce apps that support Single Sign-On (SSO), but integration with Azure App Service mobile apps back end (MBaaS) simplifies the process and gives developers a way authenticate users via Azure Active Directory (Azure AD) or social authorization, such as Twitter, Facebook, or Google. Use of Azure App Service SDK also provides developers the ability to create secure online/offline data protection, over the air and at rest, through local encryption.

Developers and IT can further manage access to back-end APIs by using Azure API Management.

IT can manage apps and devices in several ways:

• Microsoft PowerApps uses Azure AD to ensure access control across apps and connected services.

• Apps deployed and managed through Intune can set policies to restrict features of the app or to restrict the user or enforce encryption or VPN transport.

• Apps deployed to devices through Intune can be securely managed (for example, in the event of loss of the device).

Microsoft therefore offers a complete foundation for a mobile app strategy. At the same time, it is a collection of technologies with which you can optionally select and integrate with existing tools and processes. The flexibility in a broad approach and the strength in the depth of capabilities place Microsoft in a strong position for enterprise mobile apps development.

Chapter 2. Developing client mobile apps

Microsoft cross-platform mobile app development tools and platforms provide a comprehensive solution for Business-to-Consumer (B2C) or Business-to-Business (B2B) apps, giving you the means to share code across all target platforms (iOS, Android, Windows, and web) and helping you to lower your total cost of ownership (TCO).

Microsoft offers a range of developer tools for mobile client app construction that enable cross-platform or code-sharing solutions. (Note that developers who prefer to build pure native applications using native tools, such as Xcode or Android Studio, can still continue to take advantage of other tools and components from Microsoft for their back-end services or for DevOps, release management, beta testing, and analytics).

Here are some factors to take into account:

• Choice of technologies and tools (Microsoft Visual Studio Tools for Apache Cordova or Visual Studio with Xamarin/C#, Xamarin Studio, or Microsoft PowerApps) can vary depending upon several factors, as previously outlined, including developer skills, coding requirements, time to market, UX demands, app performance, and business objective (B2E or B2C, for example).

• The development platform and technologies integrate with Azure App Service capabilities (PaaS and Mobile Back End as a Service [MBaaS]) through client SDK and tool extensions, but this does not preclude a developer from choosing to integrate with third-party services or other MBaaS products.

• You can reduce TCO by sharing the same code base and by consolidating development teams and skills through a cross-platform mobile development strategy when building apps across two or more platforms (iOS, Android, and Windows), and you can achieve a faster time to market and meet higher quality, performance, and UX requirements and standards.

Choices for cross-platform mobile development

Although it’s possible to develop a native app for each platform individually (such as developing with Objective-C/Swift for iOS and/or Java for Android) and to deliver a great UX, when targeting several platforms, the costs of such an approach can be prohibitive, both in terms of time to market and TCO across the app’s lifetime. To help control and lower these costs, different cross-platform development technologies have evolved to produce platform-specific app packages from a shared code base.

For cross-platform or code-sharing solutions, Visual Studio provides a best-in-class IDE for developers on PCs. However, developers can also use cross-platform editors, such as Visual Studio Code or Xamarin Studio on a Mac. These tools focus on making the developer as productive as possible, by tightening the iterative workflow, from editing with IntelliSense to debugging with cross-platform tools and emulators.

Developers have a range of potential solutions for their cross-platform mobile apps:

• Mobile web Apps are built with HTML, CSS, and JavaScript to run in a mobile browser, and apps are deployed to a web host rather than appearing in platform app stores. Access to platform APIs is limited to those that are exposed through HTML5. Because this approach uses exactly the same skills and technologies as when developing regular web apps with single-page application (SPA) approaches with a responsive design, this ebook is not focusing on it. There are many other available resources that focus on web development.

• Hybrid using Visual Studio Tools for Apache Cordova or Visual Studio Code with extensions for Cordova Build hybrid HTML/JavaScript apps (using web development skills) by taking advantage of a single shared JavaScript API that provides full code reuse across any device, and that offers access to native device capabilities through Cordova plug-ins. Hybrid technologies fit especially well when creating B2E and B2B apps, although B2C is also a possibility, depending on the UI requirements.

With the hybrid approach, you can share components with websites and reuse web server–based apps with “hosted web apps” approaches based on Cordova.

• Native using C# and .NET with Xamarin in Visual Studio and Xamarin Studio Build stunning native apps that share nearly 100 percent of code across iOS, Android, and Windows with Xamarin Platform. To increase speed of development and efficiency, developers can use the Xamarin.Forms API to quickly build common platform-specific UI elements, or they can write directly to platform-specific APIs in C# for maximum control. With Xamarin Platform, C# developers can do anything Java, Objective-C, and Swift developers can do—with a single code base. Native Xamarin apps are a great fit for B2C apps or for enterprise apps requiring the highest levels of performance, security, and device access.

• Native, shareable components using C++ or C# (Portable Class Libraries [PCLs]) Build native components and libraries for mobile apps for any device with C++ in Visual Studio. Create impressive 3D graphics with OpenGL in C++ and embed components into Xamarin apps, or reuse legacy C++ logic/code by creating cross-platform libraries that can be reused from mobile apps.

• Native games with C#/Unity Build games with C# and Unity for all platform targets, with Visual Studio and the power that the IDE brings to bear.

• Visual Studio Code with extensions for React Native Create native mobile client apps with a nice development environment for React Native projects. You can debug your JavaScript code, quickly, run React-native commands from the command palette, and use IntelliSense to browse objects, functions, and parameters for React Native APIs.

• Data-driven enterprise apps Citizen developers, including line-of-business analysts and their counterparts in IT, can produce business apps for all platforms with Microsoft PowerApps using a no-code authoring tool with support for easy connections to back-end enterprise systems and data.

Visual Studio professional and enterprise SKUs also integrate with ALM tools in Visual Studio Team Services or Team Foundation Server.

The following sections provide more details on these options.

Building hybrid mobile apps based on HTML/JavaScript

Using Visual Studio Tools for Apache Cordova

Using HTML, CSS, and JavaScript, developers can take advantage of the skills they developed while building websites and apps to create mobile apps for iOS, Android, and Windows with Apache Cordova. Most developers achieve nearly 100 percent code reuse while using the Cordova shared JavaScript API to access native device options such as cameras, calendars, and other hardware capabilities.

A Cordova app is composed of the same HTML/JavaScript/TypeScript code that you can compile for each platform (iOS, Android, and Windows), as shown in Figure 2-1.

Figure 2-1: Visual Studio tools for Apache Cordova

Developers have the freedom to select their favorite JavaScript and controls frameworks that can integrate with Visual Studio. The range of advantages and tooling enhancements with particular patterns and frameworks includes the following:

• UI controls, like those provided by Ionic. Ionic 2 is built on AngularJS 2 (from Google), which uses TypeScript (from Microsoft). Developers get full IntelliSense and build support for TypeScript- and JavaScript-based apps.

• Visual Studio provides powerful, cross-platform development features provided in the IDE, such as emulators, device deployment, and debugging against emulators or tethered or remote devices.

• Scale to complex enterprise apps through optional TypeScript support.

• Visual Studio based on NPM acquires and installs all the necessary components (plug-ins and frameworks) required to build and maintain up-to-date Cordova-based mobile client apps.

• Visual Studio contributes heavily to the Cordova platforms and plug-ins, raising its quality and robustness.

• Visual Studio includes references to core Cordova plug-ins that are matched to the Cordova platform version for the enterprise.

• For iOS apps development, Visual Studio integrates with a remote build agent to provide builds, deployment, and debug.

• You can use Azure App Service Plugin and JavaScript libraries to connect to back-end systems and connectors and to use mobile services.

• Interoperability and flexibility. Because Visual Studio utilizes regular Apache Cordova and web technologies, your Cordova apps developed with Visual Studio can interoperate with any third-party service or technology compatible with JavaScript consumption.

Building native and cross-platform apps

Using C#, .NET, and Xamarin in Visual Studio and Xamarin Studio

Developers can create stunning native apps using C#, Xamarin, and .NET across iOS, Android, and Windows, with a shared C# code base. As illustrated in Figure 2-2, you have apps that can provide a different UI and look and feel per platform but at the same time you can share most of the C# code (client logic) or even UI Code if using Xamarin.Forms.

Figure 2-2: C# cross-platform with Xamarin and .NET

With this approach, developers can do the following:

• Take advantage of existing C# skills.

• Create 100 percent native UIs customized for each platform, using full-featured Android, iOS Designers, and Windows 10 Universal Windows Platform (UWP) Designers. Xamarin and UWP apps are native apps, so they look and feel like users expect. Developers can design their apps’ interfaces through the IDE’s designers.

• Enjoy the benefits of maximized code sharing with PCLs and Shared Projects.

• Build a custom native UI for each platform using Xamarin.iOS, Xamarin.Android, and Windows 10 UWP. Or, use Xamarin.Forms to write single, shared user interface (based on XAML) across those platforms.

• You can install the latest version of Xamarin from Visual Studio. Choose a Xamarin project to begin building your app, and use standard C# IntelliSense, debugging, and other powerful features of the Visual Studio IDE.

• Use Azure App Service SDKs to connect to back-end systems and connectors and to use mobile services in Azure like Azure Mobile App. In addition, Xamarin and .NET apps can consume any third-party service/cloud (like standard HTTP services based on JSON and OAuth).

• Benefit from interoperability and flexibility. Xamarin apps can use 100 percent of the platform’s APIs (iOS and Android) that are exposed through Xamarin/C#, which means that anything you can do in Objective-C, Swift, or Java, you can do in C# and Visual Studio with Xamarin.

Xamarin promises the industry’s fastest support for new iOS and Android APIs as they are released to the public.

Building native components by using Visual Studio C++ cross-platform

As shown in Figure 2-3, you can develop C++ cross-platform mobile code for Android, Windows, and iOS. With Visual Studio and C++, you can do the following:

• Develop shareable libraries and components by using C++ that are compiled to native.

• Share and reuse existing C++ code.

• Embed C++ components within Xamarin cross-platform apps.

• Move existing C++ libraries to target Android and Windows platforms, or use these C++ libraries to build complete Xamarin Android Native or Java Native Interface applications. You can also develop complete Android Native-Activity applications—all within Visual Studio.

Figure 2-3: C++ cross-platform

Building native games by using Visual Studio Tools for Unity

As represented in Figure 2-4, you can build games by using the Unity engine and writing C# logic in Visual Studio taking advantage of debugging, IntelliSense, and many other productivity features in Visual Studio.

Figure 2-4: Unity cross-platform

Basically, with Unity and Visual Studio you can do the following:

• Build multiplatform games

• Debug from Visual Studio

• Create Unity scripts in Visual Studio

• Enhance productivity with Visual Studio

• Take advantage of Visual Studio Tools for Unity that are natively supported in Unity

• Get Unity and Visual Studio tools all in the Unity installer

The Unity engine integrates into one unparalleled platform to create 2D and 3D games and interactive content. Create once, and publish to 21 platforms, including all mobile platforms, WebGL, Mac, PC and Linux desktop, web, or consoles.

Creating custom LoB apps quickly by using Microsoft PowerApps

Microsoft PowerApps is a tool with which you can rapidly develop web and mobile apps that are connected to existing enterprise data sources—without writing code. The product is built for those closest to the business app development process today: analysts and specialists in lines of business as well as the IT developers and system integrator partners they rely on for custom software needs. For many teams today, the process of developing business apps is slow and costly, and the demand for innovation far outstrips the capacity of developers and resources.

As illustrated in Figure 2-5, you can create simple business mobile apps targeting any mobile devices (cross-platform) that are “code-less apps” composed by UI controls (with easy drag and drop) and consume existing remote services (SaaS services, enterprise services or business systems).

Figure 2-5: PowerApps

Microsoft PowerApps changes the economics of custom software development. PowerApps Studio is visually similar to Microsoft Office, providing a visual design environment that connects to a range of data sources that businesses already rely on, from Microsoft SharePoint Online, Salesforce, and Dropbox, to Microsoft SQL Server and even custom APIs. Users can quickly build web- and mobile-optimized business apps that create, read, update, and delete (CRUD) records in Microsoft Excel spreadsheets, CRM systems, databases, and more. PowerApps also features a workflow automation tool that gives app creators the ability to initiate business processes and actions across their connected services, such as approval workflows or synchronizing records between systems.

PowerApps is ideal for a range of business app development projects. App creators can quickly modernize legacy systems by connecting to those data sources and giving them a fresh web and mobile UI. Other frequent projects include the delivery of mobile-optimized workflow forms, such as site inspection apps or quote calculators, which are specific to a business process and can take advantage of mobile features like cameras, pen inputs, and GPS location.

With PowerApps, IT developers can move much faster than they can in traditional development environments. Likewise, business specialists can directly participate in the app development process by applying their existing skills to manage screen layouts, colors, themes, and fonts, as well as creating dynamic interactions through Excel-like functions.

Following is a summary of the PowerApps service:

• An enterprise service for rapidly developing cross-platform business apps that run on the web, iOS, Android, and Windows.

• Integration with enterprise systems and data connectors. Uses mobile services, such as authentication and push notifications.

• Contains a workflow automation feature that makes it possible for app creators to initiate business processes across their connected services.

Chapter 3. Developing back-end services

Build intelligent back-end services for mobile apps with corporate sign-on and secure connection to on-premises resources and SaaS solutions. Create robust apps that remain useful when there are network issues so that users can create and modify data even when they are offline. Broadcast personalized push notifications to millions in minutes.

Microsoft Azure (cloud) and Microsoft Azure Stack (on-premises) provide the perfect home for enterprise mobile application services in the cloud where teams can concentrate on the code that matters without worrying about the scalability and security of the platform. The platform supports the back-end services required to rapidly build engaging mobile apps for enterprise needs.

Every mobile app with a cloud-hosted back end enjoys the benefits of connectivity and scale, regardless of whether that back end utilizes Infrastructure as a Service (IaaS) or Platform as a Service (PaaS).

As shown in Figure 3-1, the tradeoff between IaaS and PaaS comes down to customizability and control (Y-axis) versus speed of deployment and ease of maintenance (X-axis). IaaS virtual machines (VMs) are highly customizable—users are responsible for everything, from OS patching to middleware and runtime, to your application and its data.

Figure 3-1: From IaaS to PaaS and MBaaS

An important subset of PaaS optimized for mobile app development is commonly referred to as Back End as a Service or Mobile Back End as a Service (MBaaS). An MBaaS not only provides the connectivity and scalability that comes with all cloud-based services, it also supplies turnkey solutions for common mobile development challenges like push notifications, user authentication, and offline scenarios.

Note

Developers are not restricted to using the abstractions in an MBaaS, but are free to use API App in Azure App Service and microservices to build out custom mobile back ends.

A typical MBaaS solution (like Azure Mobile Apps) provides a turnkey way to add data storage, user authentication, push notifications, social media integration, offline synchronization, analytics, and more. The value of an MBaaS lies in its ability to let developers forget about the infrastructure and to focus on delivering a differentiated user experience (UX). Therefore, Azure Mobile Apps (part of Azure App Service) provides everything a mobile developer needs in a mobile back end for most requirements.

For more complex or customized scenarios, PaaS microservice clusters such as Azure Service Fabric can do a lot more of the heavy lifting for developers, automatically deploy OS patches and middleware especially made for microservices, and hyperscale even with stateful services with no latency between data and logic.

Mobile back ends using Azure App Service

Any mobile app with a cloud-hosted back end (whether on infrastructure or platform services) enjoys the benefits of connectivity and scalability. However, choosing an MBaaS for mobile app development yields additional benefits. MBaaS solutions are optimized to streamline connected app development (connected, because in addition to supporting popular mobile platforms like iOS and Android, most MBaaS solutions also work with Windows Store and Mac OS X apps). MBaaS solutions handle the glue code associated with the most common mobile development tasks, such as storing app data in the cloud, authenticating users, sending push notifications, and more.

Azure App Service is a cloud platform for building powerful web and mobile apps that connect to data anywhere, whether in the cloud or on-premises. As illustrated in Figure 3-2, it includes Web Apps, API Apps, Mobile Apps, and Logic Apps.

Figure 3-2: Azure App Service

Mobile back-end services with Azure Mobile Apps

Azure App Service Mobile Apps lets you do the following:

• Easily add corporate sign-in to mobile apps and securely connect to on-premises resources (single sign-on [SSO]).

• Create robust apps that remain useful when there are network issues so that users can create and modify data even when they are offline.

• Broadcast personalized push notifications to millions in minutes by utilizing a push notification service (APNS for iOS, GCM for Android, MPNS for Windows Phone, and WNS for Windows Store) in the back end.

• Easily configure for authentication by using SSO and Active Directory or social authentication providers like Facebook or Twitter.

• Many enterprises have existing enterprise systems to which you can easily connect to support mobile apps using the Azure App Service SaaS and other data connectors such as Microsoft Salesforce, Office, or Dropbox in their API or mobile apps. Similarly, because enterprises might still want to connect directly to their enterprise systems, they have options to use Azure Stack for an on-premises solution. This provides all the capability of Azure in the cloud, but on-premises.

Developers can create their back ends through the Azure portal or Microsoft tools, including quick-starts for mobile client apps, using templates for Visual Studio or other IDEs. Visual Studio also includes workflows to connect your mobile client app with an MBaaS back end.

Using Azure App Service, you can easily scale applications on demand with high availability and easy management and monitoring of assets and infrastructure through the Azure portal, which is depicted in Figure 3-3.

Figure 3-3: Azure portal with an Azure Mobile Apps dashboard

Workflow and business processes with Azure App Service Logic Apps

Using Azure App Service Logic Apps, any technical user or developer can automate running business processes and workflows via an easy-to-use visual designer (see Figure 3-4). Here’s what you can do with it:

• Create business processes and workflows visually from the web

• Deliver integration capabilities in web, mobile, and API apps

• Integrate with your SaaS and enterprise applications through connectors like Office 365, Salesforce, Google, and more

• Automate enterprise application integration (EAI), B2B, and business processes

• Connect to on-premises data and line of business services

Figure 3-4: Azure portal with Azure Logic Apps Designer

Building microservices with Azure Service Fabric

Microservices offer long-term maintainability in large, complex, and highly scalable systems by designing applications based on many independently deployable services that facilitate granular release planning. Some examples of microservices include protocol gateways, user profiles, shopping carts, inventory processing, purchase subsystems, payment processing, and queues and caches.

The microservices architecture is an approach to building a server or cloud application as a set of small services. Each microservice runs in its own process and communicates via protocols such as HTTP and web sockets. Each one implements specific, end-to-end domain/business capabilities within a certain Bounded Context and is developed autonomously and deployed independently by automated mechanisms. Finally, each service owns its related domain data model and domain logic sovereignty and decentralized data management and can employ different data storage technologies (SQL, NoSQL) and different programming languages per microservice.

Microservices can scale-out independently, as compared to giant monolithic application blocks that all scale together. This means that you can scale just the specific functional area that needs more processing power or network bandwidth to support demand, rather than unnecessarily scaling-out other areas of the application.

Designing fine-grained microservice applications promotes continuous integration and development practices and can accelerate delivery of new functions into the application. Fine-grained decomposition of applications also means running and testing in isolation. As long as you don’t break the contracts or interfaces with other microservices, you can change any microservice implementation under the hood and add new functionality without disrupting the other microservices that depend on it.

Azure Service Fabric

Distributed computing and complex microservices deployments can be difficult to manage if you do them yourself. Azure Service Fabric provides the plumbing required to create, deploy, run, and manage microservices in an effective and efficient way.

Azure Service Fabric is a distributed systems platform that you can use to build hyperscalable, reliable, and easily managed applications for the cloud. It addresses the significant challenges in developing and managing cloud applications. This frees developers and administrators from having to solve complex infrastructure problems, letting them focus instead on implementing mission-critical, demanding workloads with the confidence of knowing that these are scalable, reliable, and manageable. Azure Service Fabric represents the next-generation middleware platform from Microsoft for building and managing these enterprise-class, Tier-1 cloud-scale services.

As Figure 3-5 illustrates, Azure Service Fabric is a universal deployment environment, which means that you are able to deploy any executable based on any language (including .NET, Node.js, Java, or C++) or even database runtimes (like MongoDB). Therefore, Azure Service Fabric is not limited to microservices-oriented applications. You can also use it to host and deploy traditional applications (web apps or services) and enjoy many benefits related to scalability, load-balancing, and fast deployment.

Figure 3-5: Azure Service Fabric

Implementing data platform services by using Azure

Azure is an open ecosystem that offers a large variety of data platforms, including relational SQL databases, NoSQL databases, binary large object (BLOB)/files storage, Cache as a Service, and analytics and Big Data.

SQL databases using Azure SQL Database

Developers building SaaS applications can use Azure SQL Database to provide flexibility to support both explosive growth and profitable business models, based on the ability to scale, have high performance, high availability, and the peace of mind that comes with security. Here are some of the features that Azure SQL Database offers:

• Elastic database models and tools An elastic database gives developers the ability to pool resources to use among a group of databases for scaling, which then can be administratively managed by submitting a script as a job. The SQL Database performs the script across the databases.

• High performance High-throughput applications can take advantage of the latest version, which delivers 25 percent more premium database power.

• Backups, replication, and high availability Built-in replication and a Microsoft-backed SLA at the database level provide app continuity and protection against catastrophic events, especially when combined with active georeplication, the ability to control when and where to failover, and self-service restore, which provides full control over “oops recovery” (data restoration from available data backups of up to 35 days).

• Near-zero maintenance Automatic software is part of the service, and built-in system replicas help to deliver inherent data protection, database uptime, and system stability. System replicas are automatically moved to new computers, which are provisioned on the fly as old ones fail.

• Security Azure SQL Database offers a portfolio of security features to meet organizational or industry-mandated compliance policies. Auditing provides developers the ability to perform compliance-related tasks and to gain knowledge about activities. Developers and IT can implement policies at the database level to help limit access to sensitive data with row-level security, dynamic data masking, and transparent data encryption for Azure SQL Database. (SQL Database is verified by key cloud auditors as part of the scope of key Azure compliance certifications and approvals, such as HIPAA BAA, ISO/IEC 27001:2005, FedRAMP, and EU Model Clauses.)

NoSQL databases using Azure DocumentDB

Azure DocumentDB is a NoSQL document database service designed from the ground up to natively support JSON and JavaScript directly inside the database engine. Coding against DocumentDB is simple, approachable, and open, and it does not require custom encoding or extensions to JSON or JavaScript. With these benefits developers can do the following:

• Build modern, scalable mobile and web applications with a unique combination of robust querying and transactional data processing. Developers can extend the power of DocumentDB by using JavaScript-based custom query operators or user-defined functions.

• Rapidly develop by accessing databases through CRUD, query, and JavaScript processing over a simple RESTful HTTP interface. Developers can use a library of SDKs for JavaScript, Java, Node.js, Python, and .NET.

Storage via Azure Storage

Azure Storage is the cloud storage solution for modern applications that rely on durability, availability, and scalability to meet the needs of their customers. Azure Storage provides the flexibility and hyperscale needed to store and retrieve large amounts of data so that as storage demands increase (for example, petabytes of storage), developers can take advantage of 500 TB of total storage per account, and a single subscription supports up to 50 storage accounts. Developers can make use of REST-based APIs to access storage.

Azure Storage delivers high-performance, low-latency disk support for I/O-intensive workloads running in Azure Virtual Machines. It also is extremely durable and highly available (via replication). Here are the services that Azure Storage offers:

• Azure Blob Storage (Object Storage) Store unstructured data such as documents and media files

• Azure Table Storage For structured NoSQL data

• Azure Queue Storage For reliable message storage

• SMB-based Azure File Storage For existing or new applications

Caching by using Azure Redis Cache

Azure Redis Cache (based on the open-source Redis cache) gives developers access to a secure, dedicated Redis cache, managed by Microsoft and accessible from any application within Azure. This makes it possible for applications to become more responsive, even as user load increases, by taking advantage of the low-latency, high-throughput capabilities of the Redis engine. Using this separate, distributed cache layer, the data tier can scale independently for more efficient use of compute resources in applications.

You can easily manage Azure Redis Cache (for example, monitoring its health and performance) through the Azure portal.

More info

Azure provides additional data sources related to Big Data and analytics, but this paper focuses on mobile app development. For more information on Big Data and analytics in Azure, explore Azure HDInsight, Azure Data Lake, or Azure SQL Data Warehouse.

On-premises back-end systems via Azure Stack

Microsoft Azure Stack (see Figure 3-6) is a new hybrid cloud platform product with which your organization can deliver Azure services from your own datacenter to help you achieve more. Get the power of cloud services, yet maintain control of your datacenter for true hybrid cloud agility. You decide where to keep your data and applications—in your own datacenter or with a hosting service provider. You can easily access public cloud resources to scale at busy times of the year, for dev-test, or whenever you need them. Microsoft builds and runs its own hyperscale datacenters and delivers that proven innovation to your datacenter.

Figure 3-6: Azure Stack

Azure Stack extends the Azure vision by bringing the cloud model of computing to every datacenter. Azure Stack is a new hybrid cloud platform product that organizations can use to deliver Azure services from their own datacenters in a way that is consistent with Azure.

Organizations can create these Azure services from datacenter resources, which means that developers and IT professionals can quickly provision and scale services using the same self-service experience they find in Azure. This all adds up to an environment in which application developers can maximize their productivity by using a “write once, deploy to Azure or Azure Stack” approach, because the Azure APIs are consistent, regardless of where the resources are provisioned—Azure Stack is simply an extension of Azure.

On-premises services for mobile apps: Azure Stack App Service

The Azure Stack App Service is the Azure App Service brought to on-premises installations. It includes the web, mobile, and API services. Organizations can create content in Azure Stack App Service by using Azure Resource Manager (ARM) templates or from the Marketplace, just as they can in Azure.

With Azure Stack, developers use APIs that are identical to the ones deployed to Azure App Service in the cloud. They can create services based on .NET (like ASP.NET Web API) or non-Microsoft technologies (like Node.js) that can easily run on-premises or in the public cloud.

Back-end platform for Internet of Things with Microsoft Azure

Azure IoT Suite is an enterprise-grade solution. Developers can get started with it quickly through a set of extensible preconfigured solutions that address common Internet of Things (IoT) scenarios such as remote monitoring and predictive maintenance. These are complete, working end-to-end solutions, including simulated devices that make use of Azure services.

With integration of Azure App Service and mobile apps, developers can connect their IoT devices to ingest data to Azure, perform operations over that data, and expose the data and other APIs to client mobile applications. In particular, the following Azure products are of interest in IoT scenarios:

• Azure IoT Hub Developers can easily and securely connect new devices and existing ones by using open-source device SDKs. These SDKs are available for multiple platforms, including Linux and Windows, and they make it possible to reliably (intermittent connection) and securely send commands and notifications to connected devices and to track message delivery.

• Azure Event Hubs This is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them into multiple apps. This lets developers process and analyze the data produced by connected devices and apps and to transform and store it by using any real-time analytics provider or with batching/storage adapters.

• Azure Stream Analytics Developers can rapidly develop and deploy low-cost solutions to gain real-time insights from devices, sensors, infrastructure, and applications, such as real-time remote management and monitoring, or gain insights from devices like mobile phones and connected cars.

• Azure Machine Learning This powerful cloud-based predictive analytics service makes it possible to quickly create and deploy predictive models as analytics solutions. It provides tools to model predictive analytics but also provides a fully managed service to deploy predictive models as ready-to-consume web services. Azure Machine Learning provides tools for creating complete predictive analytics solutions in the cloud: quickly create, test, make operational, and manage predictive models.

Figure 3-7 shows a sample architecture used in the MyDriving reference app which showcases a scalable, performant, highly available, and cross platform IoT service and application. MyDriving uses a wide range of Azure services to process and analyze car telemetry data for both real-time insights and long-term patterns and trends.

Figure 3-7: A sample IoT services architecture in Azure

Chapter 4. DevOps for mobile

Microsoft Visual Studio Team Services, Team Foundation Server, Xamarin Test Cloud, and HockeyApp provide a comprehensive ecosystem for developer and IT operations with which your team can manage projects and rapidly build, test, and deploy mobile apps and back-end services.

With Visual Studio and Visual Studio Team Services (VSTS) in the cloud, along with Team Foundation Server (TFS) on-premises, development teams can productively build, test, and release for all target platforms (iOS, Android, and Windows). Teams can manage their sources (via Git or TFS) and can manage their work through scrum and bug-tracking management.

As shown in Figure 4-1, Microsoft tools can automate the pipeline for iOS, Android, and Windows device apps from global builds with VSTS, to test with Xamarin Test Cloud, to deploy to mobile devices with HockeyApp, and to provide feedback and crash analytics about the app back to the developer. Every code commit can prompt a build and deploy the app to test users. Crash data and user feedback with screenshots are directly collected when running the app and fed back into work items for the next cycle.

Figure 4-1: DevOps for mobile with VSTS, Xamarin Test Cloud, and HockeyApp

The complexity of mobile app development increases steadily with new devices, new form factors, and new operating system versions. Android runs on more than 10,000 device models, and even iOS developers now need to consider 5 different device types and 10 screen resolutions when developing universal apps for iOS, tvOS, and watchOS. To succeed in this environment, your project must automate the entire lifecycle—not only build and deployment, but also management of versions and test users, along with the collection of feedback and telemetry. In summary, VSTS offers the following capabilities (related to Figure 4-1):

• VSTS/TFS source code management (based on Git or Team Foundation Version Control), agile planning (Agile, Scrum, and CMMI are supported), continuous integration, release management, and other tools for agile teams.

• VSTS/TFS include a powerful and growing ecosystem of first- and third-party extensions with which you can easily construct a continuous integration, build, test, delivery, and release management pipeline for mobile client apps, (including options to designate your local Mac or remote Macs for iOS builds).

• VSTS/TFS builds can stream directly to HockeyApp, which deploys apps to your testers. After your app is installed on a test user’s device, HockeyApp collects usage data, crash reports, and user feedback with screenshots and will show an alert when the next build is available. Closing the loop, HockeyApp can automatically create work items for a new crash group or feedback thread and keep the status in synchronization.

• HockeyApp tightens the DevOps lifecycle with solutions for testing, A/B experimentation, beta feedback management, and crash data analytics.

• Azure App Service also supports DevOps for the back end, making it possible for you to configure and define slots for development, staging, and production, integrated from VSTS and allowing you to configure, deploy, and manage mobile services across those slots, for your mobile apps.

Managing teams and projects by using VSTS/TFS

With the ability to create an unlimited number of private Git and/or Team Foundation Version Control (TFVC) repositories, VSTS and TFS provide the flexibility needed for teams all of sizes, regardless of whether they prefer distributed or centralized version control. Support for branching and pull requests facilitates modern collaboration workflows, and gated builds and code reviews provides enforcement of best practices.

Be agile, on your terms. Capture, prioritize, and track work with backlogs and customizable Kanban boards. Work items link directly to code to ensure transparency, and you can use them to build rich dashboards for easy reporting.

Here are some of the key benefits:

• Flexible version control Use Git for distributed version control to maximize collaboration, or use TFVC for centralized version control.

• Unlimited private repositories No need to limit your development projects. VSTS/TFS provide teams with the ability to create as many Git or TFVC repositories as are needed for any project.

• Modern collaboration workflows Branches isolate risk in a development project. Pull requests provide tools that facilitate collaboration and code reviews for changes being merged back into the mainline.

• Branch policies Enforce best practices by requiring that all code submissions have code reviews, and eliminate build breaks with gated build.

• IDE integration Use your favorite language and development tool. Version control supports any language, as well as any Git client (including Xcode). Java teams can access code and work items through free plug-ins for Eclipse and IntelliJ and can run continuous integration builds based on config files from Ant or Maven.

• Build integration Create and manage build processes that automatically compile and test your applications in the cloud, either on demand or as part of an automated continuous integration strategy.

• Backlogs Quickly define, prioritize, and decompose the work for your project. Prioritization is easy with drag-and-drop reordering, which helps you keep the most important work at the top of your backlog.

• Scrum planning Scrum teams will feel right at home. Plan sprints using team-based capacity planning, drag work-item assignments where you need them, and monitor progress throughout the sprint with real-time burndown charts.

• Task boards Run your sprint using a fit-for-purpose Taskboard, where you can watch the work as it happens. Pivot the board by team member or story, making daily standups quick and efficient.

• Custom queries Using queries, you can track and organize your data to fit the needs of every project and situation. Create custom queries to look for stale work, impediments that are blocking progress, or backlog items that need attention.

Continuous integration, deployment, and release management using VSTS/TFS, Xamarin Test Cloud, and HockeyApp

Utilizing the comprehensive yet easy-to-use continuous integration (CI) support in VSTS and TFS, developers can set up and maintain an automated build and test server for any mobile platform, without needing to write hundreds of lines of custom script code. This means that you can spend more of your time building high-quality mobile apps instead of creating the infrastructure to make them operational. The completely revamped core of VSTS and TFS is fully cross-platform and adopts a lightweight task framework with a library of prebuilt tasks (see Figure 4-2) and an entire new marketplace of extensions. For the first time, builds can run on Windows, Linux, or Mac machines, opening up mobile device and server-based scenarios like never before.

Figure 4-2: Sample Team Build tasks available in VSTS

To facilitate better release agility, the new Release Management (RM) capability in VSTS/TFS makes it possible for you to set up a continuous delivery (CD) server that streamlines the process of publishing updates to beta and public stores while giving you the control and visibility needed to match your organizational needs.

Key benefits include the following:

• Continuous integration Provides a simplified, task-based experience for setting up a CI server for both native (Android, iOS, and Windows) and cross-platform (Xamarin, Cordova, and React Native) mobile apps, in addition to Microsoft and non-Microsoft (Node.js, Java)–based server technologies.

• Continuous testing Builds display integrated test results, which you can run by using Grunt, Gulp, xctool, and Gradle, among others, and which allow for automatic work item creation when failures occur.

• Test clouds Build/test pipeline integrations with Xamarin Test Cloud or with partners like Perfecto Mobile, Sauce Labs, and Keynote to run your integration and UI automation tests as part of your CI builds.

• Build agents Use the cloud-hosted build machines provided by VSTS (Windows) and MacinCloud (OS X), or configure a self-hosted build agent running on your own infrastructure that integrates with on-premises TFS or cloud-hosted Team Services instances.

• Continuous delivery Automate the deployment of your mobile apps, regardless of whether you’re publishing to HockeyApp (for beta), Google Play, or the App Store (for production). Continuously deploy the service side of your mobile apps by using Azure deployment tasks, along with Chef, Docker, and more.

• Release management Configure multiple environments for your app (QA, staging, production), each of which can have pre- and post-approvers to help ensure that updates aren’t unintentionally released.

• Marketplace The rich ecosystem of first- and third-party services extensions facilitates further customization of your CI and CD experience.

Managing a beta release program by using HockeyApp

HockeyApp provides a comprehensive solution for management of betas across your applications. All workflows for creating and managing betas are supported.

Upload of beta builds is simple through integration with workflows used by a development team to produce builds, from manual local development machine builds to integration with CI servers. You can easily manage builds by placing them in a central location—the HockeyApp service.

With HockeyApp, you can take advantage of direct over-the-air delivery to testers and to internal or external beta customer devices. Through a centralized dashboard, accessible via the web or native mobile apps, testers can have access to beta apps and all available versions, as illustrated in Figure 4-3.

Figure 4-3: Use the HockeyApp app for deployment to devices

Using the convenient mobile app notification service, you can keep your users updated about new versions or control versions in the wild by requiring users to update to a specific version.

HockeyApp provides a rich set of management tools for users and devices. Users can sign in by using existing accounts in common single sign-on (SSO) providers such as Google, Facebook, Twitter, Microsoft, and Azure Active Directory. You can gain new testers via automatic recruitment and invitation via URL links or email. You also can control access to apps and beta per user or via teams, with fine-grained controls—even down to specific versions. HockeyApp also collects user device information, helping to manage UDIDs for iOS and to understand the device test coverage.

Gathering operational and behavioral analytics by using HockeyApp

You can track application health alongside usage metrics and application crash analytics. Get powerful dashboards, in which you can filter for different views and levels of detail—from segmenting data to drilling down to an event.

Understanding real-world crash behavior is essential for mobile applications. HockeyApp’s integration of fully open-source SDKs provides highly reliable automatic crash collection of every application crash. HockeyApp crash collection is supported natively on most major mobile platforms: iOS, Android, Windows, Xamarin, Cordova, React Native, and others.

The HockeyApp dashboard provides the app owner with a summary of crashes and user feedback, including messages from users and automatic screenshots. It groups the crash reports on all platforms by similarities, as illustrated in Figure 4-4.

Figure 4-4: The HockeyApp portal for mobile app analytics

You can enjoy the benefits of powerful crash analytics tools, such as full symbolization support for iOS and .NET native code, and de-obfuscation of ProGuard on Android provides actionable human readable stack traces for all crashes. Automatic crash grouping identifies crashes resulting from the same cause. Because of HockeyApp’s integration with most major bug-tracking systems, you take advantage of streamlined workflows for notification and status tracking of crash defects. You can utilize the HockeyApp Mac app to view crash reports and navigate directly to the crashing line of code in your IDE. HockeyApp helps you to understand the device and OS distribution for each crash to gain insight into platform issues. Enable faster triage by getting the details on total impacted users for each crash.

HockeyApp gives you an opportunity to learn about basic user behavior automatically—without additional coding. It helps you to fully understand DAU, MAU, and user sessions for your application and each individual version. You can dive deeper into user behavior by tracking any user action as a custom event; visualize custom event statistics to learn about factors influencing end user behavior; and engage directly with end users via feedback with bi-directional communication from end users in-app to the development team, including the ability to share screenshots of customers’ experiences.

Getting mobile customer insights and implementing marketing campaigns by using Azure Mobile Engagement

Azure Mobile Engagement is a SaaS user-engagement platform that provides data-driven insights into mobile app usage by end users, along with real-time user segmentation. It also makes contextually aware push notifications possible as well as in-app messaging.

With Azure Mobile Engagement, application publishers and marketing professionals can better understand and interact with the app users.

Real-time actionable analytics to maximize return on investment

You can initiate engagement scenarios according to user behavior and demographics by combining Big Data collection with real-time message processing. Mobile Engagement can answer nearly any question relevant to your particular business needs. For example, you can create custom dashboards to measure key performance indicators (KPIs), rapidly find and fix usage bottlenecks in a user funnel path, track retention and user stickiness, and then determine which campaigns are driving the highest return on investment. Using the Mobile Engagement 360-degree user path view (see Figure 4-5), you can easily and continually enhance and optimize the user experience (UX), driving higher retention rates and improved app usage.

Figure 4-5: User path and app usage analytics

Value-added push and communications platform

Mobile Engagement provides in-app messaging capabilities and works seamlessly with native push notifications gateways such as Google GCM, Apple APNS, and Microsoft MPNS. And it goes beyond, giving you the power to create targeted campaigns by analyzing user behaviors to identify unique customer segments.

This benefits app developers by reaching their customers in a highly effective and nonintrusive manner, as demonstrated in Figure 4-6.

Figure 4-6: Example of marketing campaign based on push notifications created with Azure Mobile Engagement

Open APIs and ease of integration

By providing open APIs and SDKs that ease integration, you can use data from your existing CRM, CMS, or other back-end systems. This makes it possible for you to further improve your audience targeting and protect your investments.

DevOps for back-end mobile services using VSTS, Azure, and Application Insights

Developers and testers can easily and quickly provision production-like dev-test environments by using templates in Azure. Figure 4-7 shows that this pipeline can begin with Visual Studio or VSTS by initiating automated builds for every check-in and with automated deployments (CD).

Figure 4-7: DevOps for services with VSTS, Azure, and Application Insights

Developers can create automated tests at every stage of deployment and can define necessary approvals before and after deployments.

There are two fundamental technologies that are the pillars in Azure’s infrastructure:

• Azure Resource Manager Developers can provision virtual machines and any Azure PaaS components by using ARM templates saved in source control using tools with which they are already comfortable working.

• Azure Marketplace templates Developers can use the cloud as a test harness for a number of real-world situations, such as testing a large number of requests and multiple clients, simulating realistic and distributed load, at the same time validating the scale and tolerance of your application. Azure Marketplace templates have a host of test frameworks and services that give developers the ability to do functional and performance testing. Customers can take advantage of the on-demand and scalable infrastructure of Visual Studio Team Services load-testing service to generate unlimited virtual users for your application from various Azure datacenters around the globe.

Analyzing the health of back-end services by using Visual Studio Application Insights

Application Insights (Figure 4-8) is an extensible analytics service that monitors your live application. It helps you to detect and diagnose performance issues and to understand what users actually do with your app. Application Insights designed for developers to help you to continuously improve the performance and usability of your services or applications.

Figure 4-8: Application Insights

Application Insights works with both web/services and stand-alone apps on a wide variety of platforms: .NET or J2EE, hosted on-premises or in the cloud.

Application Insights is aimed at the development team. You can use it to do the following:

• Analyze usage patterns to understand your users better and to continuously improve your app.

• Count page views, new and returning users, geolocation, platforms, and other core usage statistics.

• Trace usage paths to assess the success of each feature.

• Detect, triage, and diagnose performance issues, and fix them before most of your users are aware.

• Get alerts on performance changes or crashes.

• Explore metrics to help diagnose performance issues, such as response times, CPU usage, and dependency tracking.

• Get availability tests for web apps.

• Gain insight from exception reports and alerts.

• Access the powerful diagnostic log search (including log traces from your favorite logging frameworks).

Chapter 5. Securing and managing mobile apps

Developers can build secure mobile apps, and IT managers can feel confident by securely managing mobile apps and devices in an enterprise “Bring Your Own Device” (BYOD) environment, along with their desktop infrastructure.

Securing mobile apps

With the range of possible mobile app technologies and the mobile back ends, Microsoft provides recommendations and solutions for developers creating their mobile app strategy. This ranges from components to create mobile apps that securely manage data (such as data encryption) or to provide authentication of the user (like single sign-on with Microsoft Azure Active Directory), to the ability for IT managers to securely manage the deployment of apps and devices in a corporate environment. It extends through Mobile Application Management (MAM)/Mobile Device Management (MDM) capabilities with Microsoft Intune and Microsoft Enterprise Mobility.

There are many security considerations to take into account in a mobile app strategy that cover application scenarios, IT, and developer scenarios, as shown in Figure 5-1 and explained afterward.

Figure 5-1: Main security pillars

• User identity, single sign-on (SSO), authorization and authentication Using Azure App Service and the SDKs, developers can authenticate users through a number of means such as Active Directory, Azure Active Directory for SSO support, or other social sign-in systems, such as Twitter, Facebook, and Google. It includes more fine-grained or higher levels of security through multifactor authentication (MFA) and role-based access to APIs. Azure App Service provides developers with a simple authentication process to handle the management of tokens and to facilitate federated authentication across enterprise back-end systems and SaaS providers.

• Back-end API management You can use Azure API Management to drive API consumption among internal teams, partners, and developers while benefiting from the business and operational insights available in the Azure portal. API Management gives you the tools you need for end-to-end API management—provisioning user roles; creating usage plans and quotas; applying policies for transforming payloads; and setting up throttling, analytics, monitoring, and alerts.

• Data at rest (local encryption) or in motion (communication) Azure Mobile App SDK provides the means to securely encrypt data stored locally on the device during offline/online scenarios, but developers can also make use of SDKs, Cordova plug-ins, and more for specific app scenarios, with and without Azure SDKs.

• Tamper and malware detection Microsoft Antimalware for Azure Cloud Services and Virtual Machines is a real-time protection capability that helps identify and remove viruses, spyware, and other malicious software, with configurable alerts when known malicious or unwanted software attempts to install itself or run on your Azure systems.

• Keys, certificates, and secrets Azure Key Vault helps safeguard cryptographic keys and secrets used by cloud applications and services. By using Key Vault, you can encrypt keys and secrets (such as authentication keys, storage account keys, data encryption keys, .PFX files, and passwords) by using keys that are protected by hardware security modules (HSMs). Key Vault streamlines the key management process and enables you to maintain control of keys that access and encrypt your data.

• Application and device management (MAM/MDM) With the increasing volume and diversity of both BYOD and corporate-owned devices being used in organizations today, a growing challenge for IT departments is keeping corporate information secure. Microsoft MAM and MDM solutions based on Microsoft Intune help minimize this complexity by offering management capabilities both on-premises and in the cloud, all from a single console.

Identity, SSO, authentication, and authorization

• SSO corporate authentication and authorization, Azure Active Directory, and Active Directory Federation Services Active Directory provides an industry-leading identity server, both in the cloud and on-premises, through Azure Active Directory (Azure AD) and Active Directory Federation Services (AD FS). Developers can securely authenticate, authorize, access information in Active Directory and can take advantage of device-level SSO and MFA capabilities, along with storage through the powerful Active Directory Authentication Library (ADAL), which is available for all major native and cross-platform mobile and server-side technologies. In addition, Intune MAM features include the ability to force authentication against Active Directory for any app, further enhancing an enterprise’s ability to control access to sensitive apps and data. Additionally, products like Azure Active Directory Identity Protection help security-conscious organizations implement Microsoft Identity as a Service (IDaaS) solutions with confidence.

• Internet authentication social authentication providers Azure App Service Authorization provides a unified, simplified mechanism for authenticating against Azure AD, Facebook, Twitter, Google, and Microsoft account—from not only services and web apps, but also mobile apps, through the use of Azure Mobile Apps libraries, plug-ins, and SDKs for Android, iOS, Windows, Xamarin, and Cordova. The common interface means that developers are abstracted from provider interface changes and will be able to instantly take advantage of new auth providers as they come online in the service. Azure AD now also has a preview of B2C support, giving you the ability to manage sign-ins, using credentials from Facebook, Google, LinkedIn, Amazon, and Microsoft account, and to take advantage of the same power of Azure AD available for enterprise accounts. It is currently in preview for Android, iOS, and Windows native apps, with other technologies coming soon.

• Role-based access control (RBAC), Rights Management Azure AD and AD FS are essential directories for configuring RBACs for mobile apps. Organizations can establish specific roles that have access to an app through Active Directory groups that can then be validated by using the Active Directory Graph API. In addition to app-level access controls, the broad ADAL support for server-based technologies like .NET and Node.js make it possible for organizations to further enhance their security by using these same capabilities to provide or restrict access to specific server-side data sources. In the cloud, Azure Mobile Apps can further streamline the process of getting up and running with RBACs through the use of features like Easy Tables that set up the entire infrastructure needed while still enabling developers to implement customized authorization controls. Finally, Azure Rights Management is a comprehensive cloud service with which you can implement tight role-based controls to Microsoft Office, SharePoint, and OneDrive-persisted data that extends to apps using Office APIs to access data.

Communication security

• Key management Secure Sockets Layer (SSL) provides an essential building block for all secure communications, and all Azure services support SSL-based communication. Azure Key Vault can help improve overall network-based communication security by centralizing sensitive certificates, keys, and secrets in a secure, audited hardware- or software-based central service and by removing the need for apps to maintain these values directly. With this centralization, organizations can regularly change keys globally without having to redeploy apps or services, in addition to providing a more granular level of control over the keys themselves.

• VPN and Wi-Fi access Microsoft Intune can provide additional peace of mind by enforcing mobile device resource access control policies. Using Intune, you can require VPN or secure Wi-Fi access to connect to key services, helping you to manage device profiles.

Threats analysis

• Identity protection Azure Active Directory Identity Protection takes secure identity and access management to the next level by detecting attacks in real time, informing you of risks, and applying controls to help keep your enterprise safe. The service detects suspicious activities, based on signals like brute-force attacks, leaked credentials, sign-ins from unfamiliar locations, infected devices, and more, and provides remediation recommendations to protect against these activities in real time. Based on these suspicious activities, a user risk severity is calculated, and you can configure risk-based policies that automatically protect the identities of your organization from future threats. These risk-based policies, in addition to other conditional access controls provided by Azure AD and other EMS services, can either block or provide adaptive remediation actions that include password reset requests and MFA. The service is built on a decade of Microsoft experience in protecting consumer identities, and it has special features to reduce false-positive rates and noise.

• On-premises threat detection Microsoft Advanced Threat Analytics (ATA) is an on-premises product that can help customers protect their enterprise from advanced targeted attacks by automatically learning, analyzing, and identifying normal and abnormal entity (user, devices, and resources) behavior. ATA takes advantage of deep-packet inspection technology as well as information from additional data sources (SIEM and Active Directory) to build an organizational security graph and to detect advanced attacks in real time. The solution is agnostic to the device type and operating system version—ATA witnesses all authentication and authorization.

• SaaS/Cloud Application Security Microsoft Cloud Application Security, based on the Microsoft Adallom acquisition, is a comprehensive cloud service that provides deeper visibility, stronger controls, and increased security for the cloud applications.

• Malware detection When building an internal-facing app, Intune mobile device management and mobile application management solutions detect malware on Android and report jailbroken or rooted devices for iOS and Android. You also can use Intune MAM capabilities on their own or to complement an existing MDM solution.

Data protection on device (data at rest)

Although base device encryption capabilities and cross-platform plug-ins and components can provide a certain degree of security for app developers on their own, the Microsoft Intune MAM features provide the ability to enforce policies at the app level, including encryption of all local data. It is therefore a low friction way to increase your security.

Intune provides two solutions for implementing its MAM features for Android and iOS devices: an app-wrapping tool, and an app SDK. You can run the app-wrapping tool on internal line-of-business (LoB) Android and iOS apps to activate certain capabilities such as limiting cut-copy-paste while the app is running, requiring a PIN, or requiring app-level encryption. The Intune App SDK takes this a step further, making it possible for apps to designate corporate data only for protection, leaving personal data completely intact, and ensuring that users cannot store their data in personal app-connected services.

Managing client mobile apps and devices

As part of Enterprise Mobility Suite (EMS), Microsoft Intune provides organizations with the ability to manage mobile devices, PCs, and apps so that employees are productive and a company’s information remains protected.

• Mobile device management IT administrators use mobile device management to manage, monitor, and secure employees’ mobile devices. Intune supports MDM of iOS, Android, Mac, and Windows devices. IT administrators can manage both personal and corporate devices, with users’ ability to enroll their devices and install apps with Intune via a company portal app. Using the Intune admin console, IT administrators can manage a variety of scenarios, including policies, corporate email, certificates, VPN, and many more device settings. They also can use Intune Conditional Access policies to control access to on-premises Microsoft Exchange email from mobile devices.

• Mobile app management MAM is typically used for deploying and managing employees’ apps. With Intune MAM, IT administrators can deploy and manage both store and internal company apps, while ensuring that data remains protected in these apps through MAM policies configured by the administrator.

Intune MAM also offers a variety of options for data protection. You can manage apps with and without MDM, making it possible for companies with BYOD devices to manage apps with little friction for their employees. You also can deploy MAM alongside third-party MDM providers with a goal to meet customers’ needs, regardless of where they are. In addition, IT administrators can manage a large ecosystem of MAM-compliant productivity apps, including Microsoft Office apps and third-party apps such as Adobe Reader and Box.

Developers can set up their mobile apps for MAM through Intune App SDK, which supports native iOS and Android, in addition to Cordova and Xamarin. IT administrators can also utilize an app-wrapping tool to configure compiled LoB apps for management. After an app has been set up for MAM, administrators can deploy a variety of policies to protect corporate app data, leaving personal data intact, to help ensure an uncompromised user experience.

Securing mobile apps end to end with Microsoft Intune MAM

IT administrators can deploy MAM policies that protect data and help safeguard secure access. Intune App SDK typically handles the implementation of these policies, creating a consistent experience for administrators across apps and letting developers to quickly turn on MAM.

The Intune App SDK (MAM) supports Xamarin apps, Cordova apps, and also single-platform language/SDK apps like Objective-C apps for iOS and Java/Android-SDK apps for Android.

Figure 5-2 shows an example of an Intune policy being edited with available security options which can be applied in a decoupled way (no need to code) in mobile apps managed by Intune.

Figure 5-2: Sample policy for Intune App SDK in the Intune portal

After an app is set up for MAM, an IT administrator can do the following:

• Control users’ ability to move corporate documents Administrators can deploy a policy that turns off file backup apps to prevent backing up corporate data to the cloud.

• Configure clipboard restrictions They can deploy a policy so that users are unable to use the clipboard to cut/copy from an Intune-managed app and to paste into a nonmanaged app.

• Enforce corporate access requirements Administrators can require an access challenge to the user, such as full authentication or app PIN, to launch the app. Authentication relies on the users’ Active Directory identity and therefore can benefit from all Active Directory identity features. Intune App SDK uses Azure AD to provide an SSO experience in which the credentials, after they are entered, are reused for subsequent sign-ins. Authentication of identity management solutions federated with Azure AD are also supported.

• Enforce encryption on saved data Administrators can enforce a policy that ensures that all data stored on the device by the app is encrypted.

• Remotely wipe corporate data Corporate data can be remotely wiped from an Intune-managed app when the device is unenrolled from Microsoft Intune. This feature is identity-based and deletes only the files that relate to the corporate identity of the end user.

• Enforce the use of a managed browser Using the Intune-managed browser helps to ensure that links that appear in emails (in an Intune-managed mail client) are kept within the domain of Intune-managed apps.

• Check device health and compliance Administrators can check the health of the device and its compliance with corporate policies before users access Intune-managed apps. On the iOS platform, this policy checks whether the device has been jailbroken. On the Android platform, this policy checks whether the device has been rooted.

Chapter 6. Conclusions

Enterprise mobile apps are constantly evolving, with high expectations from the business, either around improved quality or reduced time to market. To survive in this new era, mobile app development leaders must be able to establish an end-to-end development strategy based on platforms that cover every area in the app’s lifecycle but that are also flexible and interoperable with other platforms.

Key takeaways

Here are the most important takeaways for you to glean from this ebook:

• Cross-platform world Mobile devices and operating systems are fragmented across different vendors (iOS, Android, and Windows). As soon as an enterprise designates more than one platform, “siloed” development approaches (different skills and development teams per OS) provoke very high costs. A cross-platform mobile strategy can help lower your total cost of ownership (TCO) by consolidating skills and development teams.

• Interoperability and multichannel No single development platform or approach solves all mobile app use cases in the enterprise. Therefore, platforms and technologies (not only for developing client apps and back-end services, but also for DevOps, security, and management) must be able to interoperate and integrate with different vendors and technologies. Interoperability must be driven by a multichannel strategy based on back-end services/API, consumable from mobile apps and web apps, and based on any platform/technology.

• Flexibility Mobile app technologies (mobile devices, languages, and operating systems) evolve fast compared to traditional development. This can lead to the instability of many tools (especially OSS platforms that are improved in a very dispersed way), resulting in the need for the enterprise to adopt a flexible architecture strategy with agile tactics across different vendors rather than rigid end-to-end bounded platforms.

• App lifecycle improvement The increasing demand for mobile apps means that you need to accelerate app development and delivery while still assuring quality. You can achieve this by improving productivity in the development processes, increasing the collaboration between development and IT operations (DevOps), and having an agile application lifecycle with fast but reliable continuous delivery. Agile frameworks supported by automated build/test/delivery tools, plus production management tools, are fundamental for achieving those goals.

As mentioned at the beginning of this ebook, Microsoft offers a complete foundation for a mobile app development strategy—a collection of technologies to choose from that integrate with existing tools and processes. This flexibility in a broad approach and this strength in the depth of capabilities provide the ability to adopt the E2E platform covering the entire lifecycle or to adopt only specific technologies complementing your existing environment, depending on your needs.

Appendix: Technology decision tables

Mobile app development technologies

Microsoft offers a variety of technologies and tools to support the approach you take for cross-platform (web, hybrid, or native cross-platform). No matter which development platform and technology you select, it is supported by Visual Studio—one of the most powerful integrated development environments available and one that provides among the highest quality development experiences.

As far as frameworks, components, and libraries are concerned, Microsoft supports a large variety of them. These vary, depending on the specific approach (hybrid and cross-platform versus native and cross-platform).

Hybrid and cross-platform: Visual Studio Tools for Apache Cordova

Development platforms and technologies for hybrid/Cordova mobile apps (iOS, Android, Windows)

Microsoft development tools for hybrid/Cordova

Languages for hybrid mobile apps (iOS, Android, Windows)

Main web frameworks for Apache Cordova

Native and cross-platform: C#—Visual Studio with .NET and Xamarin

Development platforms and technologies for C# cross-platform mobile (iOS, Android, Windows)

Development tools for Xamarin (iOS, Android, Windows)

Main frameworks and SDKs for C#/Xamarin/.NET

Rapid Mobile App Development (RMAD) with Microsoft PowerApps

PowerApps-related technologies

Back-end and cloud services technologies

Microsoft offers a large variety of technologies and tools to be used when creating back-end and cloud services. Microsoft covers the most important approaches for mobile back ends (MBaaS, PaaS, and microservices, among others) and for IoT back ends.

PaaS and MBaaS

Azure App Service / Azure Stack App Service–related technologies

The Azure App Service technologies can be used from the Azure public cloud (in Azure App Service) and from the on-premises implementation of Azure, called Azure Stack (in PREVIEW, as of H1 2016).

PaaS: Microservices and hyperscale

Azure Service Fabric technologies

Azure Service Fabric is a platform especially made for hyperscale and microservices architecture–based applications. It offers several APIs and programming model options, depending on the needs.

Service development technologies

Service development technologies with .NET

Data platform in Azure for mobile apps

Note that Big Data (HDInsights/Hadoop) and other data sources for analytics like Azure Data Lake and Azure Data Warehouse are excluded from the MADP scope. Big Data is not specific to MADP but is worth further exploration in other contexts.

Data services in Azure

DevOps for mobile: Tools and SDKs

Microsoft offers a large variety of tools and SDKs to increase efficiency in your application lifecycle management and DevOps work and to improve collaboration between development teams and IT operations.

Development team collaboration services and tools

Services/servers for end-to-end ALM and DevOps

Microsoft offers ALM and DevOps capabilities in the cloud and on-premises.

Both approaches are valid when managing the application lifecycle of mobile apps, and the Microsoft goal is to have the highest possible feature parity for both environments, although usually innovation comes first for the cloud approach. This is because the cloud accommodates continuous deployment and innovation. Innovation is adopted in a slower cadence when it is released as software for on-premises installation.

Services/servers for ALM, code/build/test/deployment, and tracking

Analytics, monitoring, and learning

Technologies for securing mobile apps

Microsoft offers a large variety of technologies and SDKs to secure mobile apps. The following tables drill down on the specific technologies per approach/area so that you can get insights as to when to use each technology.

Identity, SSO, and authentication

Infrastructure for identity providers

Authentication client SDKs for mobile apps

SDKs for Azure Active Directory and Active Directory

Managing and securing mobile apps and devices

MAM/MDM

Other security products

Security