Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile design patterns

Mobile design patterns

Alexandra Marin

May 11, 2017
Tweet

More Decks by Alexandra Marin

Other Decks in Programming

Transcript

  1. Case study #1: Different capabilities Case study #2: Different platform

    { crossplatform.io } #mobile #designpatterns #itakeunconf
  2. //On platform if(deviceHasCamera) { //Take photo via Camera app //Apply

    resizing //Save it via File Manager } else { //Choose from gallery } { crossplatform.io } #mobile #designpatterns #itakeunconf crossplatform.io
  3. { crossplatform.io } #mobile #designpatterns #itakeunconf //Shared code class MyCalendar

    { ICalendar calendar; void SaveTheDate() { calendar.AddEvent(); } } crossplatform.io
  4. { crossplatform.io } #mobile #designpatterns #itakeunconf //iOS iOSCalendar : ICalendar

    { AddEvent() { //add event with //EventKit } } crossplatform.io
  5. { crossplatform.io } #mobile #designpatterns #itakeunconf //Android DroidCalendar : ICalendar

    { AddEvent() { //add event with //CalendarContract } } crossplatform.io
  6. //Construct on platform Locator.RegisterType <ICalendar, iOSCalendar>(); //Use in shared code

    Locator.Resolve<ICalendar>(); { } #mobile #designpatterns #itakeunconf { crossplatform.io }
  7. { crossplatform.io } #mobile #designpatterns #itakeunconf //Construct on platform IoC.RegisterType

    <ICalendar, iOSCalendar>(); //Gets injected in shared class constructor public SharedClass(ICalendar cameraHelper) { crossplatform.io }
  8. Ask Me Anything crossplatform.io or @xmonodev { crossplatform.io } #mobile

    #designpatterns #itakeunconf { crossplatform.io } crossplatform.io