building poollie wk 2014 for ios android and windows phone using xamarin and azure

22
Building Poollie: WK 2014 + = + + Maarten Sikkema Vincent Hoogendoorn

Upload: vincent-hoogendoorn

Post on 24-Jun-2015

232 views

Category:

Mobile


4 download

DESCRIPTION

I gave this demo on Nov 4, 2014 at the Microsoft event "Mobile Cross-Platform Development with Xamarin and Visual Studio" in Hoofddorp, The Netherlands. This is the story and the lessons we learned cretaing a succesful real-world cross-platform app, built in C# with Xamarin and Visual Studio for iPhone, Android and Windows Phone - Poollie: WK 2014

TRANSCRIPT

Page 1: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Building Poollie: WK 2014

+ = + +

Maarten SikkemaVincent Hoogendoorn

Page 2: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

The Dream

Let’s make a fun app for the World Football Championship• To learn what it takes to make a successful app

• To show off what is possible using Xamarin, Azure and .NET

• To promote our company as an App Developer

Started seriously developing 10 weeks before the kickoff of the first match

Put up a “coming soon” webpage

Little did we know…

Page 3: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

www.poollie.nl

Page 4: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

The “competition” in this category

Mostly webbased systems:• watgaathetworden.nl / ING Bank

• flexvoetbal.nl

• nationalevoetbalpool.nl

One mobile App:• Not free

• iOS / Android, no WP

In this category, a mobile app has many advantages over a website

Page 5: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Poollie features

• User registration

• Create / search pool

• Invite players

• Notifications

• View Championship Schedule and Standings

• Predict matches, predict winners and stats

• View (live) match, calculate player points

• View player points (self / others)

• View Pool standings

• …

Even an app as simple as Poollie has a lot of features

More info (in Dutch):

Het Verhaal van Poollie

Page 6: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Poollie technology

iOS and Android: Xamarin• Native UI

• On-device database

• REST / SignalR connection to server

• Shared Code

Windows Phone 8:• Native UI

• Shared Code

Plain-and-simple architecture

Server: Windows Azure Website• ASP.NET WebAPI + SignalR

• SQL Server + Micro ORM, Migrations

• WebJobs for background processes

• Service Bus to scale SignalR

• Notification Hub

Page 7: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Xamarin Platform

Apps look and feel native, because they are

Productive app development environmentLanguage Framework IDE

Page 8: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Client Technologies

Leveraging the .NET cross-platform ecosystemMore info:

Lessons Learned

Page 9: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Three native apps, one source

Page 10: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Three native apps, one source

Navigation logic also shared

More info: github.com/MacawNL/QuickCross

Page 11: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Three native apps, one source

DEMO

More info:See YouTube Video

Page 12: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Marketing PoollieA good App doesn’t really sell itself

It takes work to market an App, make people notice…

Page 13: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Success! Houston, we have a problem• Peaked at 200.000 screen views per hour

• 100+ web api requests / sec

Statistics and exception logging are critical

Page 14: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Scaling the serverCloud makes it possible to buy yourself out of trouble quickly

Just click the buttons…

Page 15: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Scaling the server

More cost efficient: old-fashioned SQL data modelling and query tuning, i.e:

SELECT ROW_NUMBER() OVER(ORDER BY Points DESC) AS CurrentPosition, ROW_NUMBER() OVER(ORDER BY (Points-LastPointMutation) DESC) AS PreviousPosition, PoolId, PlayerId, DisplayName, Points, LastPointMutation FROM PoolPlayer INNER JOIN Player ON PoolPlayer.PlayerId = Player.IdWHERE PoolPlayer.PoolId = @PoolId AND PoolPlayer.PlayerStatus BETWEEN 5 AND 6ORDER BY CurrentPosition

Page 16: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

SELECT CurrentPosition, PreviousPosition, PoolId, PlayerId, DisplayName, Points, LastPointMutation FROM PoolPlayer INNER JOIN Player ON PoolPlayer.PlayerId = Player.Id WHERE PoolId = @PoolId AND PoolPlayer.PlayerStatus > 4ORDER BY RowNumber

Scaling the server

More cost efficient: old-fashioned SQL data modelling and query tuning, i.e:

Page 17: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Client PerformanceEliminating all web requests from the app startupLoad minimum data from local storage for initial display.Once the app is interactive, start background load of more local dataAlso start an attempt to update with online data

Optimizing AsyncPerformance of non-UI code with ConfigureAwait(false)Poollie has 300 awaits in shared code.

Replacing sqlite-net / IQueryable with Json.NET / IenumerableEliminate mapping layers and slow IO More info:

Lessons Learned

Page 18: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Demo: Notifications

In-App Notifications with SignalRFaster and more reliable delivery, free, 2-way persistent

Push Notifications with Azure Notification HubAlways reach people

More info:See YouTube Video

Page 19: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Xamarin Experience: Grip and Freedom

Grip: not hitting a roadblockPerformance

Memory

Look & feel

Latest platform-specific functionality

Freedom: mix and matchDevelop on Mac and on Windows machines

Use Visual Studio and Xamarin Studio IDEs

Use .NET (NuGet) and native libraries

Use Shared Code Projects and Portable Class Libraries

Share view markup (Xamarin Forms) and use native markup

Page 20: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

Achievements

We did allright

47000 users with on average 25000 users every day during the championship; 2500 concurrent users at peak times.

Voted as number one World Championship pool app by iPhoneclub.nl

Voted as best pool app for World Championship in Brazil by Androidworld.nl

Selected four times as Featured App in the Dutch Windows Phone Store

90% of the client-side code was shared across all three platforms, while each platform had its own native designed UI

We provided continuous app updates with improvements and new features in all three app stores, right up to the end of the championship

Page 21: Building poollie wk 2014 for ios android and windows phone using xamarin and azure

ResourcesDutch Mobile .NET Developers GroupXamarin Revolve: Tuesday, November 11, 2014 6:00 PM, Hilversumhttp://www.meetup.com/Dutch-Mobile-NET-Developers-Group

Macaw mobile solutionshttp://www.macaw.nl/

@MaartenSikkema http://www.macaw.nl/macaw/medewerkers/maarten

@VincentH_NET http://vincenth.net