Xamarin workshop
Nguyen Nhu Hieu – SMIC Technical Lead - Development
Agenda
 Portable Class Library (PCL)
 XAMARIN iOS
 Objective C & C#
 XIB UI
 XAMARINAndroid
 Java & C#
 AXML UI
 MVVMCross
 MVVM & Data Binding
 Multiplatform Extension
Portable Class Library (PCL)
 1 Solution
 Multiple Platforms
Portable Class Library –Why?
 Centralized Code Sharing
 Consistent Structure
 Seamless Debug
 Easy to maintain
 Project Sharing (Core)
 NuGet
 XamarinComponent
Store
PCL - Platform IndependentAPIs
 Platform – specific libraries cannot be referenced
 No Silverlight ControlToolkit
 No P/Invoke , pointer, overloading function to C/C++
 PCL is a subset of .NET Framework
PCL Diagram
Compilation Flow
 iOS: C# > Objective C >
APP
 Android: C# > Java > APK
 WP/ Store: C# > XAP
Xamarin iOS
Xamarin iOS
Xamarin iOS – In Code
 100% Components ported to C#
 iOS UI can be done without XIB/ StoryBoards
Xamarin iOS - Xcode Designer
Xamarin iOS - Storyboard
Xamarin iOS
Demo
Xamarin Android
 JavaTranslation via
Sharpen
 XobotOS
Xamarin Android
 Activity
 Intent
 Resources
 Services
Xamarin Android UI
Xamarin Android
Demo
Model –View -ViewModel
ViewModel
Model
get/set
Properties
callCommands
notify changes
some messaging
Whatever C# you
like!
View
View
ViewModel
ViewModel
Model
Model
Mvvm Cross PlatformView
ViewModel
Model
SharedPlatform Specific
get/set
Properties
callCommands
notify changes
some messaging
Whatever C# you
like!
View
View
ViewModel
ViewModel
Model
Model
MVVMCross – Dev Flow
1. Create Services – ‘Back end’ – PCL .cs
2. CreateViewModels – PCL .cs
3. CreateViews
• .AXML - Mono for Android – (tablet and) phone
• .XIB and .cs - MonoTouch for iOS – iPad and iPhone
• .XAML -WP7 andWinRT
MVVM Cross - Binding
MVVMCross - Converter
MVVMCross - Converter
MVVMCross - Command
MVVMCross
Demo
MVVMCross – UI Generics
 List
 Form
MVVMCross - Generics
 Tabs | Pivot | Panorama
Multiplatform Solution - PushSharp
Multiplatform Solution - PushSharp
PushSharp iOS
PushSharpAndroid
PushSharp –Windows Phone
Umbraco
CMS
SQL
Server
Custom
WebAPI
(JSON + REST)
Core Logic,
including:
- REST client
- Caching
- ViewModels
SQLite
XAML (Win8)
XAML(WP8)
AXML(Android)
XIB/SB (iOS)
Shared
Entities
Client Apps Server
PCL
PCL
.Net4 .Net4
Xamarin.iOS
Xamarin.Android
Silverlight
WinRT
Demo
 Prebuilt
 Employee Directory App
 Field Service App
 Xamarin Store
Xamarin DevelopersVietnam
 https://www.facebook.com/groups/860110274003469/
 http://www.meetup.com/Xhackers-Vietnam/
 XamarinTurns 3 event in June.

Xamarin workshop

Editor's Notes

  • #9 Objective C & C# Slide XIB Xamarin Studio & Visual Studio Compile
  • #14 Helloworld
  • #15 Java vs C#: who developed notice the extreme similarity Dalvik: VM for Android App. Limitation for speed. Even Oracle provided VM Hotspot to speed it up Sharpen: Xamarin tool for Translating Java to C#. Day to day update XobotOS: Xamarin android OS
  • #16 Activity: Page Controller Intent: Activity navigation Services: Thread, Thread Pool, Java Process Resources: Data (Image, Video), Localization, Resource file R for indexing UI components
  • #17 Similar to Windows Phone XAML
  • #18 HelloWorld Android TaskyPortable
  • #20 Binding INotify ObservableCollection
  • #21 Only UI on specific platform project, Everything else in Core C#
  • #26 Book Lumia VIP (Location, Localization, ErrorReport Messenger)
  • #29 MPNS - Microsoft Push Notification Service  APNS - Apple Push Notification Service GCM - Google Cloud Messaging that replaces C2DM – Cloud to Device Messaging
  • #30 Multiplatform implementation Nuget
  • #34 CMS – Content Management System SB - Storyboard