Portable Class Library Deep Dive
#ShareMoreCode
James Montemagno, Developer Evangelist
@JamesMontemagno
www.MotzCod.es
Portable Class Libraries
•1 Assembly
•Multiple Platforms
Portable Class Libraries
•1 Assembly
•Multiple Platforms
•Including:
• Xamarin.Androi
d
• Xamarin.iOS
Why Portable Class Libraries?
• Centralized Code Sharing
• How you expect it to work
• Debug seamlessly into and out of PC...
Platform Independent APIs
• Platform-specific libraries can’t
be referenced
• E.g. No Silverlight Control Toolkit
• No P/I...
What can I use?
Well Documented
Microsoft NuGet Libraries
•
•
•
•
•
•
•
•
•

Async for .NET Framework 4, Silverlight 4 and 5, and WP 7.5 & 8
Microsoft BCL...
Available to Everyone!
• Easier to use
• Easier to create
• True Cross
Platform Portable
Class Libraries
Awesome PCL Libraries
•
•
•
•
•
•
•

MvvmCross
ReactiveUI
Akavache – Async Persistent Key-Value Store
Splat – Image Loadin...
Demo
Inversion of Control (IoC)
• Service Locator
• Obtain Service/ViewModel with
strong abstraction layer
• Platform Specific ...
Examples
•
•
•
•

XPlatUtils
PortableIoC
Ninject
About 1000 other ones.
Or Your Own?!?!
• 50 Lines of Code
• http://bit.ly/50-lines-ioc
Demo
Summary
• Portable Class Libraries are
AWESOME!
• Create + Share PCLs EASY
• Be aware of PCL “profiles”
• Lowest Common De...
Resources
• Source Code
• http://bit.ly/planet-xamarin
• Getting Started with PCL
• http://bit.ly/pcl-get-started
• Me
• @...
Q&A
Portable Class Library Deep Dive
Upcoming SlideShare
Loading in …5
×

Portable Class Library Deep Dive

747
-1

Published on

Slides from Houston Xamarin C# Developers Group in Houston Texas on December 16th 2013:

PCL Deep Dive: With a single solution in Visual Studio, build native cross-platform apps for iOS, Android, and Windows all in C#. Dive into platform specific code with Service Locators (IoC) an PCL support

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

  • Be the first to like this

No Downloads
Views
Total Views
747
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
27
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Platform-specific libraries cannot be referenced (eg. Community.Csharp.Sqlite.WP7)
    PCL is a subset and may not include classes that might be available in full class library.
  • Change to httpclient
  • Let’s look at Xamarin and VS 2013 to build modern apps on
    iOS, Android, and Windows
    Let’s start with something familiar
  • Let’s look at Xamarin and VS 2013 to build modern apps on
    iOS, Android, and Windows
    Let’s start with something familiar
  • Platform-specific libraries cannot be referenced (eg. Community.Csharp.Sqlite.WP7)
    PCL is a subset and may not include classes that might be available in full class library.
  • Let’s look at Xamarin and VS 2013 to build modern apps on
    iOS, Android, and Windows
    Let’s start with something familiar
  • Portable Class Library Deep Dive

    1. 1. Portable Class Library Deep Dive #ShareMoreCode James Montemagno, Developer Evangelist @JamesMontemagno www.MotzCod.es
    2. 2. Portable Class Libraries •1 Assembly •Multiple Platforms
    3. 3. Portable Class Libraries •1 Assembly •Multiple Platforms •Including: • Xamarin.Androi d • Xamarin.iOS
    4. 4. Why Portable Class Libraries? • Centralized Code Sharing • How you expect it to work • Debug seamlessly into and out of PCL • Project/Assembly Sharing • NuGet
    5. 5. Platform Independent APIs • Platform-specific libraries can’t be referenced • E.g. No Silverlight Control Toolkit • No P/Invoke to C/C++ • PCL is a subset of .NET
    6. 6. What can I use?
    7. 7. Well Documented
    8. 8. Microsoft NuGet Libraries • • • • • • • • • Async for .NET Framework 4, Silverlight 4 and 5, and WP 7.5 & 8 Microsoft BCL Build Components Microsoft BCL Portability Pack Microsoft Composition Microsoft Compression Microsoft HTTP Client Libraries Microsoft Immutable Collections Microsoft ASP.NET SignalR .NET Client ODataLib
    9. 9. Available to Everyone! • Easier to use • Easier to create • True Cross Platform Portable Class Libraries
    10. 10. Awesome PCL Libraries • • • • • • • MvvmCross ReactiveUI Akavache – Async Persistent Key-Value Store Splat – Image Loading Budgie – Twitter Library Azure Mobile Services Json.Net • SO MANY MORE!!!
    11. 11. Demo
    12. 12. Inversion of Control (IoC) • Service Locator • Obtain Service/ViewModel with strong abstraction layer • Platform Specific Code • Through Interfaces
    13. 13. Examples • • • • XPlatUtils PortableIoC Ninject About 1000 other ones.
    14. 14. Or Your Own?!?! • 50 Lines of Code • http://bit.ly/50-lines-ioc
    15. 15. Demo
    16. 16. Summary • Portable Class Libraries are AWESOME! • Create + Share PCLs EASY • Be aware of PCL “profiles” • Lowest Common Denominator • Portable Class Libraries are
    17. 17. Resources • Source Code • http://bit.ly/planet-xamarin • Getting Started with PCL • http://bit.ly/pcl-get-started • Me • @JamesMontemagno • www.MotzCod.es
    18. 18. Q&A
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×