14
Starting Mobile Development Pranav Ainavolu Microsoft MVP | Developer @ RealPage, Inc. @a_pranav | http://pranavon.net/

Starting Mobile Development

Embed Size (px)

Citation preview

Page 1: Starting Mobile Development

Starting Mobile Development

Pranav AinavoluMicrosoft MVP | Developer @ RealPage, Inc.

@a_pranav | http://pranavon.net/

Page 2: Starting Mobile Development

Demo Architecture

Portable Models & Code Services

Portable View Models

Portable UI based on Xamarin.Forms

UWPAndroid iOS

Shared code

Android

Page 3: Starting Mobile Development

DemoNew Project Foundation

Portable Models & Code Services

Portable View Models

Page 4: Starting Mobile Development

Foundation• Models & Base Services• Models• Services & Business logic• Platform-specific service

Interfaces• Architectural Services

• Object repository for IoC/DI• Command class

• View Models• Architectural Services

• Base View Model class• Core View Models Portable Models & Code Services

Portable View Models

Page 5: Starting Mobile Development

DemoAdding the Platform Layers

Portable Models & Code Services

Portable View Models

Portable UI based on Xamarin.Forms

UWPAndroid iOS

Shared code

Page 6: Starting Mobile Development

Shared vs. Portable Class Library Projects• Code in a shared project compiles as if it

is part of each project that references it• Therefore, code must be valid in all

referencing projects but can use #ifdef directives to compartmentalize platform-specific code regions if necessary

• Alternatively, Portable Class Libraries are separate referenced assemblies targeting a lowest common denominator across specified platforms

• Both may call injected ‘service’ objects• PCL may be succeeded by the .NET

Standard library for new projects later in 2017 Portable Models & Code Services

Portable View Models

Portable UI based on Xamarin.Forms

UWPAndroid iOS

Shared code

Page 7: Starting Mobile Development

Cloud Services• Azure Storage

• Blob – REST-based• Queue• File – SMB sharing• Disk

• Azure App Service Mobile Apps• Data store with offline sync• REST-based API end points to data or coded functions built with C# or

node.js• Authentication available against corporate or personal identity providers

• Many other services for large data, IoT, notifications, logic flow, BI, etc.

Page 8: Starting Mobile Development

DemoConnecting to the Cloud

Portable Models & Code Services

Portable View Models

Portable UI based on Xamarin.Forms

UWPAndroid iOS

Shared code

Page 9: Starting Mobile Development

NuGet client library package integration• REST-based Azure Storage

client libraries available as a NuGet package for portable class libraries• Azure App Service Mobile App

client with SQLite libraries operate at head-level projects, injected into lower-level code with interfaces

Portable Models & Code Services

Portable View Models

Portable UI based on Xamarin.Forms

UWPAndroid iOS

Shared code

Page 10: Starting Mobile Development

DemoSecuring Cloud Access

Page 11: Starting Mobile Development

Shared Access Signature• Azure App Service Mobile App code has access to a key

for Azure Storage, which is used to generate temporary Shared Access Signatures (SAS) for Azure Storage blob operations.• That code is exposed as a custom REST-based API end

point• The mobile app calls the custom API end point to get a

SAS• The SAS is for a specific resource, specific operation and

for a duration• Can also secure custom end points with identity

providers

Page 12: Starting Mobile Development

DemoCompleting the Shared UI

Portable Models & Code Services

Portable View Models

Portable UI based on Xamarin.Forms

UWPAndroid iOS

Shared code

Page 13: Starting Mobile Development

DemoUsing a Native UI

Portable Models & Code Services

Portable View Models

Portable UI based on Xamarin.Forms

UWPAndroid iOS

Shared code

Android

Page 14: Starting Mobile Development

Resources• Further sessions in this series:

• Practical Mobile Development – consistent UI using Forms, incorporating DevOps, hands-on lab

• Learn about Xamarin - https://www.xamarin.com/platform • Get started for free on Mac & PC - https://store.xamarin.com/• The Xamarin Show -

https://channel9.msdn.com/Shows/XamarinShow • Xamarin University - https://www.xamarin.com/university