C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

32
@slodge C# - Cloud to Mobile Survival, Inquiry, Sophistication

description

Talk given at London Azure conference 2012 - ScottGu was my warm up :)

Transcript of C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Page 1: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

@slodge

C# - Cloud to Mobile Survival, Inquiry, Sophistication

Page 2: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

C# Cloud

C# Clients

C# Cloud-Client Communication

C# Code

Real App Examples

Q&A

What we’ll be talking about

Page 3: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

1. How can we eat?

2. Why do we eat?

3. Where shall we have lunch?

Survival, Inquiry, Sophistication

“The History of every major Galactic Civilization tends to pass through three

distinct and recognizable phases, those of Survival, Inquiry and Sophistication,

otherwise known as the How, Why, and Where phases. For instance, the first

phase is characterized by the question 'How can we eat?' the second by the

question 'Why do we eat?' and the third by the question 'Where shall we have

lunch?”

― Douglas Adams, The Restaurant at the End of the Universe

Page 4: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Shared code across mobile and cloud

“low level”: compiles, typesafe, quick

Native performance

Native look and feel

Testable

Libraries: commercial and open – and nuget!

Generics, Linq, async/await and the future…

You already have: skills, tools, code

Why C#?

Page 5: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Storage – lots of it

Connectivity – lots of it. Continuous. Global

Processing – lots of it. Scalable. Burstable.

Privacy/Security

Quick updateability

Toys – ACS, Queuing, CDN, TrafficManager, Caching, Services, …

Why Azure?

Page 6: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Examples: Lottery Results

Web Role

Storage

Worker Role

Push

Page 7: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Azure is:

big

cheap

Azure is not:

infinite

free

Important

Page 8: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

TweetPic

Demo: Code

Azure

Website Azure

Storage

SQL

Azure

Page 9: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Storage: SQL via EF Code First

Page 10: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Storage: Azure Blob Uploads

Page 11: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Data Services: WCF oData

Page 12: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Data Services: Json ASP.Net MVC

Page 13: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Size Matters

JSON list of 100 pictures XML Gzip JSON

58kB 21kB 2kB

JSON

Page 14: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Server:

Storage:

Code First Entity Framework

Azure C# SDK

Logic/Services:

Custom C#

Twitterizer

Presentation:

ASP.NET MVC (Json)

WCF (oData)

TweetPic Server

Sophistication: Lots of C# Server

technologies are available:

nHibernate

RavenDB

Lucene.Net

MVC Async (+SignalR)

ServiceStack

Azure - Access Signatures

WebAPI

OpenRasta

Simple.Web

Nancyfx

FubuMvc

ASMX and WebForms

ProtocolBuf.Net

Page 15: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Survival: Simple TweetPic Client

WP7

XAML

+ C# CodeBehind

Page 16: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Survival: Simple TweetPic Client

Page 17: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Inquiry: TweetPic Client

Service Consumption

Business Logic

Local Data/Services

UI Logic - ViewModels

Presentation - WP7 – XAML

Page 18: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Sophistication: TweetPic Clients

Service Consumption

Business Logic

UI Logic - ViewModels

WP7 – XAML Win8 – XAML iOS – XIB/MT.D Droid – AXML

Local Data/Services

Page 19: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Sophistication: TweetPic clients

Page 20: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Declarative Presentation

Page 21: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

C# App Stack

WP7 iOS Droid Win8

Data Access

Business Logic

Presentation

Service Consumption

Business Logic

Local Data/Services

UI Logic

Page 22: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Examples: RunSat

Non Cloud

Web Site

Blob

Storage

SQL

Server

Page 23: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Examples: SQLBits Conference App

Page 24: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Azure Website based

Service Download

Twitter Authentication

Checkin

Checkin Scoreboards

Photo Upload

Examples: Azure London Conference App

Page 25: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Example: Azure London Conference App

Page 26: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Examples: Xbox Advertising Apps

Page 27: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Example: Xbox Advertising Apps

Page 28: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Example: Xbox Advertising Apps

Page 29: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

Examples: AzureApp

Page 30: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

C# Cloud

C# Clients

C# Cloud-Client Communication

C# Code

Real App Examples

Q&A

Recap

Page 31: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

For server:

azure.com

Wade Wenger’s talks on WP7/Android/iOS toolkits

watwp.codeplex.com

For clients:

create.msdn.com

xaminars from xamarin.com

github.com/slodge/mvvmcross

For more info…

Page 32: C# - Azure, WP7, MonoTouch and Mono for Android (MonoDroid)

@slodge