Starting Out Right with Xamarin

Starting Out Right with Xamarin

Starting out right with Xamarin and other useful tips, tricks and resources p.s. this is just my opinion RYAN DAVIS QUEENSLAND C# MOBILE DEVELOPERS MEETUP 2015 06 23 whoami Ryan Davis Hobby Developer Work in Information Management LINQPad all day baby Blog: Github: @rdavisau sockets-for-pcl, sockethelpers write socket comms in shared code jsondatacontext-linqpad json data context driver for LINQPad

current swag status: fanatic to cover Mobile principles to live by Pop Quiz your first big questions Spotlight on some useful libraries Roundup of resources. # 1 -= mobile principles to live by =- know platform

love thy neighbour why Xamarin, again? (not at all MECE) Xamarin because: Write code in powerful, expressive languages Take advantage of the .NET platform and ecosystem TARGET ALL THE PLATFORMS!! Share as much code as we can Avoid Java and Objective-C and swift Dont want to have to learn about the native platforms. not all mobile platforms are created equal

Xamarin is not designed to relieve you of the need to understand the underlying platform: Android, iOS and WP differ on many levels UI, app lifecycle, sandboxing and restrictions Each platform might be more or less suited to a given application or programming paradigm MVVM and databinding WinRT Custom drawing and animation iOS Doing whatever you want Android. forunately, we can make use of native docs Xamarins iOS/Android frameworks are C# idiomatic, but otherwise almost identical to the native ObjC/Java counterparts A book or course targeting iOS or Android native is still relevant, especially for frameworks like UIKit and CoreAnimation Tutorials and documentation are easily adapted

Probably the biggest deviation from native API naming: - tableView:cellForRowAtIndexPath: NATIVE iOS GetCell(,) XAMARIN iOS . : You have access to a lot of platform resources for learning see the resource roundup for suggestions # 2

-= mobile principles to live by =- crossplatform ^ begin with the end in mind MVVM + PCL is a match made in heaven The MVVM + PCL method is proven and good By now, the community has settled on the combination of MVVM and a portable core assembly as an effective way to write cross platform apps. Native Project Native Project

Portable Class Library Native Project From a Xamarin From a google image result for MVVM go MVVM with a PCL from the beginning Keeping your viewmodels in the core project and your views in native projects encourages Good Habits You cannot accidentally use platform-specific and non-PCL APIs You cleanly separate your viewmodel and views, and your code goes into the viewmodel by default

You can write the majority of your application logic without fiddling with UI and you can do it in LINQPAD if you want You can access platform-specific functionality transparently using PCL shims. . # 3 -= mobile principles to live by =- try not to re-invent the whee cross-platform mobile is new, but not

that new There are a lot of new considerations that didnt necessarily apply to the old world of desktop and MVC. Many problems have already been solved We do get the benefit of the existing .NET libraries, where PCL-compatible There are a lot of Xamarin libraries out there already dial before you dig A little research may save you a lot of hours! There probably isnt a need for another MVVM or DI framework MvvmCross, ReactiveUI, MVVMLight TinyIoC, Ninject, Splat, Autofac, Unity There very well could be a need for more cross-platform abstractions See the resource roundup for a catalogue of useful libraries and abstractions. #

4 -= mobile principles to live by =- win friends and influence peo aka. get involved in the community the Xamarin OSS ecosystem is strong Xamarin is new for us, but there are a lot of people who have been doing cool stuff with the platform for a long time For newcomers, it can be hard to know whats out there, which libraries are reliable, etc. it can help to start following the work of others For a good summary of whats happening, subscribe to the Weekly Xamarin Newsletter

giving back has lots of benefits Credibility in the community Credibility with future clients / employers No cost: In order to ensure that all open source projects that want to add or maintain compatibility with Xamarin have access to the tools they need, we offer open source projects with app store compatible licenses non-commercial subscriptions to our products for the purposes of developing, testing, and maintaining compatibility with Xamarin. Active developers on established open source projects can fill out this form to apply Youll feel good helping people Z I U Q PO P Answering the tough

questions question #1 question #1 NATIV E VS HYBRI D/WEB

question #2 PCL PORTABLE CLASS LIBRARY A class library that works against a portable subset of .NET APIs - those supported by all the platforms you are targeting. The de-facto standard for cross-platform Xamarin/Mobile apps. Just use this. VS

SHARE D Essentially, a hardened version of linked files Still useful for sharing XAML between Windows Store/Phone apps Seriously, just use a PCL question #3 Xamari n VS

Xamarin.For ms question #3 Xamari n VS Xamarin.For ms Guidance at for which platform to use when You can mix and match Xamarin.Forms pages with native views Xamarin.Forms might be more capable than you thought question #3 Xamarin.Forms in Anger question #4 Visual Studio Resharper

Good dark theme Windows Phone/Store Easy to work with Azure and ASP.NET resources if your app involves them Its familiar VS Xamarin Studio Better designer experience, particularly iOS Faster build/deploy times for iOS You can make changes to your files while the app is running! Sketches

Update NuGet Packages I use both question #5 Parallel s VS Bootcamp ESX VS

Hyper-V question dev box) #5 (setting up your The true challenge of cross platform: You need a Mac to build/run iOS apps You need to be running Windows + Hyper-V to run the WinPhone emulator Android is chill and runs everywhere, thanks buddy hey NBD What can we do?

My advice - Get a Mac and keep your options open Use Bootcamp, you can boot Windows direct or use Parallels/VMWare from OSX (Parallels seems to perform best, this result has been consistent for several releases now) If youre brave, you can also boot your OSX partition in VMWare when t h g i l t o p S on some cool libraries

I ran out of time there are only 2 how to use HttpClient to query a JSON API Step 1:Reconsider. hello ModernHttpClient and Refit ModernHttpclient - HttpClient implementations that use platform-native HTTP clients for :rocket: Looks like an HttpClient, acts like the best native implementation!

Refit - The automatic type-safe REST library for Xamarin and .NET Create an interface for your API, annotated with verb and URL stem Type-safe API methods, async, (de)serialization come for free! Supports all the best verbs, body parameters, authentication, static and dynamic request headers and generic interface definitions. persisting data - Akavache Cross-platform file system access is Hard but it has been solved Consider whether you need file system or just to save stuff

Akavache gives you async-friendly key-value persistence + more Has a GetAllObjects() method Facilitates caching and expiry: GetOrFetchLatest(string key, Func, DateTimeOffset expiry) Specific methods for encrypted storage e.g. user creds Resource roundup people to watch, follow, reach out to etc. (not comprehensive) Globals Subscribe to the Weekly Xamarin Newsletter!

@paulcbetts Paul Betts, developer of ReactiveUI, Refit, ModernHttpClient, Akavache, Splat, Fusillade, etc. @jamesmontemagno James Montegamo, developer evangelist @ Xamarin, behind the Plugin for Xamarin push, lots of Android Material Design stuff, generally cool enthused dude @mikebluestein old timer, ex-Xamarin, big on CocosSharp and now Apple Watch @robgibbens - Rob Gibbens, XU instructor, writes top blog posts @

@saramgsilva Sara Silva, New Xamarin MVP, Azure focussed samples, etc. @shanselman Scott Hanselman, MSFT.. just because @xamarinhq of course. Locals Join the public Xamarin Slack room! @glenntstephens Glenn Stephens, runs this here meetup, XU instructor, long time Monotouch

@geoffreyhuntley Sydney, long timer? Active in the Xamarin/.NET OSS scene @kent_boogaart Kent Boogart, serious coder, under-marketed, active blog - @rid00z Michael Ridland, new Xamarin MVP cross-platform / general MVVM MvvmCross - Popular cross-platform MVVM library

ReactiveUI - MVVM library based on the Reactive Extensions and FRP principles MVVM Light Toolkit - Another MVVM library Helpful Libraries Akvache - - An asynchronous, persistent key-value store Splat - - A library to make things cross-platform that should be

(logging, service location, colours, images, geometry) ModernHttpClient - - HttpClient that uses platform-native HTTP clients for Refit - - The automatic type-safe REST library for Xamarin and .NET Polly - - express transient exception handling policies such as Retry, Retry Forever, Wait and Retry or Circuit Breaker in a fluent manner Lager - - cross-platform settings storage

Reactive Extensions - - a library for composing asynchronous and eventbased programs using observable sequences and LINQ-style query operators. cross-platform / general (continued) Platform Abstractions Xamarin Plugins - - catalogue of x-platform NuGet packages XF-Labs - - XF-specific controls and a few platform abstractions

SimplyMobile - - Collection of abstracted mobile functionalities Xamarin Component Store - - some paid On the Bait and Switch / Advanced PCL method for excruciating detail on making one xamarin.forms Good articles, series, books etc. Creating a Xamarin Forms App [12 part series]

Creating Mobile Apps with Xamarin.Forms (Preview) [its a book, free] Xamarin Forms Kickstarter [its a book too, paid] Xamarin Forms in Anger

[still-ongoing series] Xamarin Forms Recipes [still-ongoing series?] Supercharging Xamarin Forms with Custom Renderers [4-part series] Getting Started with Xamarin Forms Labs [blog post] Xamarins XF Developer Portal game dev CocosSharp and Monogame Xamarins got game (development) [introductory blog post] Introduction to Game Development with Xamarin [official Xamarin documentation] Creating a basic game in CocosSharp [3 part series. it really is a basic game though] [code and slidepack] Intro to CocosSharp [official Xamarin presentation]

cocos2d Ray Wenderlichs cocos2d posts [there are lots] Learn cocos2d [book, paid] native platforms iOS Beginning iPhone Development [book, paid, 40% off right now?] -

Ray Wenderlichs site - iOS Dev Center [apples own] - Droid Pro Android, 5th Edition [currently alpha, full release 20/05/2015] - Programming Mobile Apps for Android, Part 1 [Coursera, began 17/06] - https:// [its official] - Windows Phone Windows Phone 8.1 Dev for Absolute Beginners [MVA] - Building Apps for Windows Phone 8.1 Jump Start [MVA] - + approximately 999,999,999,999 courses on Pluralsight training / misc Xamarin University - Pluralsight - Microsoft Virtual Academy -

Xamarin Evolve conference videos 2014: 2013: Planet Xamarin Xamarin Community Blogs Also check out PaintCode for iOS: questions / thanks

Recently Viewed Presentations

  • Big Question: - Scottsboro

    Big Question: - Scottsboro

    Test Tip: You may be asked to identify the correct past tense of an irregular verb. Learn which verbs are irregular and practice using their past forms. The birds . flew. away. The birds . have flown. away. We ....


    REFERENCES. NAVSEA OP-5, Volume 1 Ch14. NAVSUP P-801. Field-Return Ammunition Inspection Guide v.14. NAVMED P117, CHNG 135. MCO 3570.1C. MCO 5530.14A . MCO 8010.13
  • The MYP at SCJ

    The MYP at SCJ

    IB World-wide - 3295 . schools in. 141 . countries. 58 PYP . 146 MYP. 141 DP. ... Name two MYP Global Contexts. Can you name the criterion by which you are assessed in each subject area? ... Explain how...
  • Reconstruction - Loudoun County Public Schools

    Reconstruction - Loudoun County Public Schools

    Reconstruction Policies. Soldiers from the North supervisedthe South. Carpetbaggersfrom the North took advantage of the South during Reconstruction. Rights for African Americans were gained as a result of the Civil Rights Act of 1866, which also authorized the use of...
  • Measuring and Managing SLP Workload and Caseload

    Measuring and Managing SLP Workload and Caseload

    Estimate the time per year spent in miscellaneous contact with outside agencies and parent conferences=N. ANN. Estimate time spent per year with correspondence with outside agencies, emailing parents, etc., parent conferences, SSI paperwork, misc. This N will be divided in...
  • SGW WIMS task management solution -

    SGW WIMS task management solution -

    SGW also produced a number of more complex daily forms for tests like Cl2 demand, jar testing and chemical delivery. Although we were really happy with these forms we found it difficult to ensure all operators were using them as...
  • Filing A Trade Adjustment Assistance Petition -

    Filing A Trade Adjustment Assistance Petition -

    Trade Adjustment Assistance. Petitions must be submitted within one year of the layoff/closure to the USDOL. USDOL will conduct an investigation of the layoff/closure. After the investigation, DOL determines group eligibility to apply for TAA benefits and services.

    WRITER'S NOTEBOOK #1. 1. Who is the intended audience for this article? Identify at least two different techniques the authors (Newsela Staff) use to appeal to their audience, and explain how these techniques are effective tools to gain the audience's...