Welcome!
Sharing up to 80% ofcode building mobileapps for iOS, Android,WP8 and Windows 8 RoyCornelissenIT Architect,Info Supportper...
Key takeaways DemosArchitecture Tips & Tricks
Showcase
National web site, aimed at selling the “last availableseats” for theatre shows for up to 4 daysNo discount or auction sit...
Demo
MindsetLessons we’ve learned over the yearsStuff that actually works in practiceNot only theoreticallyWe target iOS, Andro...
What we’ve heard the past few daysMany cross platform talksTalks on frameworksThis session is about a real app, notjust an...
Reusable34%Shared Logic17%Android10%iOS8%Windows Phone10%Services21%Shared84%Specific16%Per App
Evaluate frameworksMonoCrossMvvmCrossRoll your ownFrameworks can help speed updevelopment but they might also limityour mo...
DataSerializationCachingSecurityAuthN/AuthZEncryptionData Self DestructionUtilitiesAnalyticsLoggingDevice servicesPlatform...
Navigation frameworksIn our experience, navigationframeworks yield leaky abstractions.E.g. PivotView navigation experience...
WindowsOne pivotviewover multipledatarepresentations
AndroidTab bar stylenavigation withseparateactivities
ServicesModelControllerViewModelEtc.GPSStorageMotion sensorsViewShared?BridgeShared  Platform specific
Model ImplementationWe implement the Model as a SingletonModel Implements INotifyPropertyChangedEasy to enlist subscribers...
Model Implementationpublic class MainModel : INotifyPropertyChanged{private static MainModel _model;private static object ...
Check your water levelReusable Business LogicDevice SpecificXAML / ValueConverterModel PropertyValue Transformation
public class ISKEController{private static ISKEController _instance;private ISKEDomainServicesoap _proxy;public static ISK...
Shared ControllerUIViewController XAML View ActivityWeb ServicesSFSFSFModelGetActualEvents(Action<object> OnSuccess,Action...
Demo
iOSMonoTouch.CoreLocationMonoTouch.CoreMotionMonoTouch.AVFoundationMonoTouch.AddressBookMonoTouch.EventKit…Android:Android...
Partial classes & methods
partial class A{// Half of the implementation}partial class A{// The other half}A.cs A.extra.cs
partial class A{// Declare the method herepartial void DoSomethingEx();public void DoSomething(){// Some shared logicDoSom...
Demo
Services – Use soap?Proxy generationSilverlight tools: it needs to run on Windows too!What about bandwidth?
Services – Use REST/JSON?WebAPI / ServiceStackMore hand codingCloud: Azure / Parse / Buddy
Cross platform version controlGitHub, BitBucketVisualStudio.comWork items, builds
Demo
C# language tricksLeverage your tools
Abstractions are goodBut don’t over-abstractDon’t over-engineerBeware of pitfalls…
@roycornelissenroycornelissen.wordpress.comThank you!@marcelvblogs.infosupport.com/marcelv
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries
Upcoming SlideShare
Loading in …5
×

Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries

4,457 views

Published on

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,457
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
111
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App Case Study, Roy Cornellisen and Marcel de Vries

  1. 1. Welcome!
  2. 2. Sharing up to 80% ofcode building mobileapps for iOS, Android,WP8 and Windows 8 RoyCornelissenIT Architect,Info Supportper,Info SupportMarcelde VriesTechnologyManager@marcelvXamarinEvolve2013RoyCornelissenITArchitect@roycornelissen
  3. 3. Key takeaways DemosArchitecture Tips & Tricks
  4. 4. Showcase
  5. 5. National web site, aimed at selling the “last availableseats” for theatre shows for up to 4 daysNo discount or auction site, but a source forinspiration for a fun night outOrder tickets from home, from a terrace or from yourhotel room
  6. 6. Demo
  7. 7. MindsetLessons we’ve learned over the yearsStuff that actually works in practiceNot only theoreticallyWe target iOS, Android and WindowsLeaving out Windows can give a different perspectiveon reuseShowcase: app for a retail startupCurrently being rebranded
  8. 8. What we’ve heard the past few daysMany cross platform talksTalks on frameworksThis session is about a real app, notjust an exampleImportant: we also target WindowsVery different UI paradigms, impacts code structure andlevel of reuse
  9. 9. Reusable34%Shared Logic17%Android10%iOS8%Windows Phone10%Services21%Shared84%Specific16%Per App
  10. 10. Evaluate frameworksMonoCrossMvvmCrossRoll your ownFrameworks can help speed updevelopment but they might also limityour movements by (over)abstractionKeep as lightas possible
  11. 11. DataSerializationCachingSecurityAuthN/AuthZEncryptionData Self DestructionUtilitiesAnalyticsLoggingDevice servicesPlatform Agnostic APIApplication Business LogicPlatform UIDesign Patterns for ReuseGlue together theapplication layers
  12. 12. Navigation frameworksIn our experience, navigationframeworks yield leaky abstractions.E.g. PivotView navigation experienceis not the same as menu navigationvia UINavigationController.Leave UI navigation devicespecific
  13. 13. WindowsOne pivotviewover multipledatarepresentations
  14. 14. AndroidTab bar stylenavigation withseparateactivities
  15. 15. ServicesModelControllerViewModelEtc.GPSStorageMotion sensorsViewShared?BridgeShared  Platform specific
  16. 16. Model ImplementationWe implement the Model as a SingletonModel Implements INotifyPropertyChangedEasy to enlist subscribersFacilitate automatic databinding in XAMLModel contains rich features such as filtering andadvanced selectionsEasy to share logic
  17. 17. Model Implementationpublic class MainModel : INotifyPropertyChanged{private static MainModel _model;private static object _lockHandle = new object();// Facilitates Windows Phone app resumepublic void RestoreState(MainModel state){_model = state;}public static MainModel Current{get {if (_model == null) {_model = new MainModel();}return _model;}}public IEnumerable<Event> ActualEvents {get {// E.g. Complex linq stuff}}}// Model Usage:var foo = MainModel.Current.ActualEvents;
  18. 18. Check your water levelReusable Business LogicDevice SpecificXAML / ValueConverterModel PropertyValue Transformation
  19. 19. public class ISKEController{private static ISKEController _instance;private ISKEDomainServicesoap _proxy;public static ISKEController Current{get {if (_instance == null) {_instance = new ISKEController();}return _instance;}}private void GetActualEvents (Action<object> OnSuccess, Action<Exception> OnFail){// do some logic, or service call// use actions to report result or trigger UI action}}
  20. 20. Shared ControllerUIViewController XAML View ActivityWeb ServicesSFSFSFModelGetActualEvents(Action<object> OnSuccess,Action<Exception> OnFail)PropertyChanged(“Events”);public void OnFailed(Exception e){// Do something with error}public void OnSuccess(object data){// Do something with data// Notify user}
  21. 21. Demo
  22. 22. iOSMonoTouch.CoreLocationMonoTouch.CoreMotionMonoTouch.AVFoundationMonoTouch.AddressBookMonoTouch.EventKit…Android:Android.Hardware.SensorAndroid.LocationAndroid.BluetoothAndroid.Nfc…Windows Phone:Microsoft.Devices.Sensors.GyroscopeMicrosoft.Devices.Sensors.AccelerometerMicrosoft.Devices.Sensors.CompassMicrosoft.Devices.Sensors.Motion…
  23. 23. Partial classes & methods
  24. 24. partial class A{// Half of the implementation}partial class A{// The other half}A.cs A.extra.cs
  25. 25. partial class A{// Declare the method herepartial void DoSomethingEx();public void DoSomething(){// Some shared logicDoSomethingEx();}}partial class A{// Provide the implementation herepartial void DoSomethingEx(){// Do something iOS specific}}Can be used from sharedlogicLeaves room for specificimplementationAlways private and returnsvoidA.cs A.iOS.cs
  26. 26. Demo
  27. 27. Services – Use soap?Proxy generationSilverlight tools: it needs to run on Windows too!What about bandwidth?
  28. 28. Services – Use REST/JSON?WebAPI / ServiceStackMore hand codingCloud: Azure / Parse / Buddy
  29. 29. Cross platform version controlGitHub, BitBucketVisualStudio.comWork items, builds
  30. 30. Demo
  31. 31. C# language tricksLeverage your tools
  32. 32. Abstractions are goodBut don’t over-abstractDon’t over-engineerBeware of pitfalls…
  33. 33. @roycornelissenroycornelissen.wordpress.comThank you!@marcelvblogs.infosupport.com/marcelv

×