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

Real Cross-platform Mobile Applications - The A...

Real Cross-platform Mobile Applications - The Anti-Pattern

A talk about porting Days Until Xmas from Windows Phone to iOS to Windows 8 and Android given at BCS Edinburgh

Chris Hardy

July 03, 2013
Tweet

More Decks by Chris Hardy

Other Decks in Programming

Transcript

  1. WINDOWS PHONE - 2010 • DispatchTimer for Snow/Time timer •

    Pivot Control for time display • Use MarketplaceReviewTask to Review app • Use EmailComposeTask to Share app • Live tile using ScheduleTileNotification
  2. MARKETPLACE REVIEW • http://wp7reviews.tomverhoeff.com • Over 1,200 reviews reviewBu(on.Click  +=

     (s,  e)  => {            AboutFlipBack.Begin();            var  reviewTask  =  new  MarketplaceReviewTask();            reviewTask.Show(); };
  3. EMAIL COMPOSE TASK • No other sharing functionality const string

    marketplaceUrl = "http://bit.ly/acLe1V"; var emailTask = new EmailComposeTask(); emailTask.Subject = "Days Until Christmas on Windows Phone 7!"; var sb = new StringBuilder(); sb.Append(String.Format("Hey!\ nCheck out this days until Christmas app on the Windows Phone 7 marketplace! Don't worry, it's free. \ nDownload here: {0}\ n", marketplaceUrl)); sb.Append(String.Format("Only {0} {1} left until Christmas!\ n", _time.DaysUntil.ToString(),(_time.DaysUntil == "01") ? "day": "days")); sb.Append("Merry Christmas\ n"); emailTask.Body = sb.ToString(); emailTask.Show();
  4. LIVE TILE WITH SCHEDULE TILE NOTIFICATION • Don’t build an

    app that needs a constantly updating icon! • 2011 the live tile was online only... • http://daysuntilxmaswp7.info/{0}/image.png where {0} is the time offset • Provided analytics based on the information sent to the server
  5. WINDOWS PHONE - 2011 • 6,151 installs from 1st Jan

    2011 to 8th Nov 2011 • Updated Live Tile to be local • Updated the description before publishing - oops. • Featured on the Marketplace!
  6. IOS - 2012 • NSTimer.CreateRepeatingScheduledTimer for time countdown • CAEmitterLayer

    for snow falling • Two UIScrollViews for time display, abusing DecelerationEnd and SetContentOffset • NSUrl.OpenUrl for Reviewing the app • UIActivityView for sharing with friends • No live tile...
  7. SHARING CODE • No shared code, copy and pasted code.

    Bad, I know... • MusicOptions, TimeInformation, TimeHelper and defaults • Sharing thoughts and ideas OR NOT...
  8. WINDOWS 8 - 2012 • DispatchTimer for Snow/Time timer •

    ScrollView + Hacks for time display, abusing ViewChanged / Storyboards • Reviewing the app is build in (I found out the hard way) • Sharing is built in with DataTransferManager • Settings different on Windows Phone/iOS and Windows 8 • Live Tile on Lock Screen
  9. ANDROID - 2013 • Used Animation and AnimationDrawable • ScrollView

    ??? • MarketUri and Activity to Review the app • Sharing is built with a ShareActionProvider • Settings is done via the menu option and alert dialog • No live tile... again • In the future...
  10. BUILD YOUR OWN COUNTDOWN APP? OPEN SOURCING DAYS UNTIL XMAS

    IOS • Get the code from github.com/chrisntr/daysuntilxmas • Apache 2.0 license • Analytics removed • Uses Xamarin.iOS and works great on the Starter edition • Xamarin.Android version to be open sourced soon in an unfinished state... • Windows Phone and Windows 8 versions to be open sourced soon
  11. SHARING THE APP • iOS <meta name=”apple-itunes-app” content=”app-id=0000000” /> •

    Windows 8 <meta name=”msApplication-ID” content=”appId” /> <meta name=”msApplication-PackageFamilyName” content=”name” /> DAYSUNTILXMAS.COM
  12. - User 5 Stars “It's fun because you don't forget

    how many days there is le! lol” Dec 27th 2012
  13. - User 3 Stars “3stars cause it tells you how

    long CHRISTMAS is!!!! =)” Dec 11th 2012
  14. “I love this app its really cool :D and I

    will I use is every day for my life. My cousins love it and the falling snow is a blast”
  15. - Belinda 5 Stars “I love this app its really

    cool :D and I will I use is every day for my life. My cousins love it and the falling snow is a blast” Dec 26th 2012
  16. “That is stupid you calculate simply time to get to

    Christmas ... Ufffffffff because it does so yucky Windows Phone??????/,”
  17. - Rita 1 Star “That is stupid you calculate simply

    time to get to Christmas ... Ufffffffff because it does so yucky Windows Phone??????/,” Dec 11th 2012
  18. “This is super cute and works just the way I

    would expect it to. I love Christmas!!”
  19. - Maya Bree 5 Stars “This is super cute and

    works just the way I would expect it to. I love Christmas!!” Jan 24th 2013
  20. Q&A