4 steps to great xplat apps (m

22
4 steps to great x-plat apps Alexey Strakh Alex Sorokoletov

Upload: alexey-strakh

Post on 16-Jul-2015

124 views

Category:

Software


0 download

TRANSCRIPT

Page 1: 4 steps to great xplat apps (M

4 steps to great x-plat

appsAlexey Strakh

Alex Sorokoletov

Page 2: 4 steps to great xplat apps (M

Hey, we’re Alexey and Alex

• Certified Xamarin Developers

• Microsoft MVP

• Multiple apps with Xamarin and MvvmCross

• Recent example - one solution with

iOS/Android/WindowsPhone/WPF

Alexey Strakh @AlexeyStrakh

Alex Sorokoletov @AlexSorokoletov

Page 3: 4 steps to great xplat apps (M

Step 1. Use MVVM

Page 4: 4 steps to great xplat apps (M

MvvmCross is the way

1.Crossplatform

2.Lots of components baked in

3.Proven solution

4.Extendable and opensource

5.Crossplatform glue between view and

viewmodels

Page 5: 4 steps to great xplat apps (M

Step 2. Reuse the code

1. PCL

2.Solution structure

3.App structure

Page 6: 4 steps to great xplat apps (M

Use PCL

• Lots of 3rd party components (nuget)

• Flexibility

• One place

• Less efforts to maintain code

Page 7: 4 steps to great xplat apps (M

Proven solution structure

• App.Core project (Shared code)

• App.Android project (sometimes App.Droid)

• App.iOS project

• App.OtherPlatform projects

Page 8: 4 steps to great xplat apps (M

Mvx app structure

• Components

• Startup

• Navigation

• Presentation layer

Page 9: 4 steps to great xplat apps (M

App.cs code

Page 10: 4 steps to great xplat apps (M

MvxSetup.cs

Page 11: 4 steps to great xplat apps (M

AppDelegate.cs

Page 12: 4 steps to great xplat apps (M

Maximize shared code

Top reused things in crossplatform applications:

• Icon

• Splash

• Title

• Description

Wait!… What about code?

Page 13: 4 steps to great xplat apps (M

Demo 1Hello, x-platform world

Page 14: 4 steps to great xplat apps (M

Step 3. Databind your UI

Views and ViewModels

Page 15: 4 steps to great xplat apps (M

Mvx bindings

1.Declarative

2.Code-behind

3.iOS/Android/WP/WPF/Mac/Silverlight

Page 16: 4 steps to great xplat apps (M

Demo 2Bindings

Page 17: 4 steps to great xplat apps (M

Step 4. Use platform features

• Facebook native authentication

• Photos and camera access

• Push notifications

• Mail composer

• Background execution

Page 18: 4 steps to great xplat apps (M

Platform-specific services

1.Register

2.Resolve

Page 19: 4 steps to great xplat apps (M

MvvmCross plugins

• Location

• Phone dial

• Picture chooser

• Compose email

• Vibrate

• Sqlite

• Social authentication

• Many other at drmtm.us/mvxplugins

Page 20: 4 steps to great xplat apps (M

Demo 3Real API integration

Page 21: 4 steps to great xplat apps (M

Advanced topics

• View presenters

• Custom views

• Custom bindings

• Mvx app lifecycle

Page 22: 4 steps to great xplat apps (M

Stay in touch

@AlexeyStrakh

@AlexSorokoletov

MvvmCross:

github.com/MvvmCross

stackoverflow.com/questions/tagged/mvvmcross