SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Building Apps with common code for
Windows 8 and WP8
Tamir Dresher
Senior Software Architect
Nov 26, 2013
About Me
•
•
•
•

Software architect, consultant and instructor
Technology addict
.NET and Native Windows Programming
http://www.TamirDresher.com.
One step towards convergence - UX
•
•
•
•
•

Tiles
Touch interface
AppBar
Navigation
Similar XAML
Controls
One step towards convergence - Code
• Common native API – DirectX, WinSock, CRT, STL and more
• WinRT - Infrastructure, common type system, standard
programming model. Projected C#, VB, C++ and JavaScript
• Shared .NET engine
Life is not perfect
• There are still parts that doesn’t exist in the other platform
– System.Threading.Tasks.Parallel, PLINQ etc.
– System.Collections.Concurrent namespace

• There are Things that exist but with differences
– Dispatcher

• There are things that exist but just don’t work
WinRT under different platforms
Networking
Proximity
In-App Purchase
Sensors
Location
File System
Core app model
Threading

http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626516(v=vs.105).aspx
Demo
Common Code between platforms
• There are Basically 3 techniques
– Link Files
– Portable Class Library (PCL)
– Dependency Injection
Add as Link
• Using the same file in multiple projects, without copying the
file to each project.
•

Shared

•

Not Shared
Add as Link
• Changes in one immediately reflects in the other
• Compilation can change due to Conditionals
Demo
Add as Link – When To Use
• Application logic that is shared but is not portable – each
platform has its nuance
• Code that is written in WinRT API.
• User controls with no platform dependencies (NOT XAML)
– You can use conditional compilation in your code-behind class
Portable Class Library (PCL)
• Portable Class Libraries support a subset of .NET assemblies
that target the platforms you choose.
• One code -> one project -> one binary for all platforms
• Unsupported in VS2012 Express edition
Portable Class Library (PCL)
•
•
•
•

Supports managed code only
Doesn’t use conditional compilation related to platform
Doesn’t use WinRT API
Isn't relevant to UI constructs - XAML code isn’t portable
Demo
Portable Class Library – When To Use
• Shared Managed Code that deals with Logic
• Code that doesn’t depends on specific platform API
How To Deal with Non-Portable Code
• Using the Adapter Pattern
PCL
ISomeService

WP8

Win8

ServiceAdapterWP8

ServiceAdapterWin8

3rdPartyWP8

3rdPartyWin8
Sharing UI Code
• Separate UI from app logic
Summary
•
•
•
•
•

Separate UI from app logic
Share your logic in PCL
Use Linked Files when necessary (WinRT)
Abstract your dependencies and use DI
We are on the path for convergence but there is still a long way
to go
Presenter contact details
c: +972-52-4772946
e: tamirdr@codevalue.net
b: TamirDresher.com
w: www.codevalue.net

Weitere ähnliche Inhalte

Was ist angesagt?

C# code sharing across the platforms
C# code sharing across the platformsC# code sharing across the platforms
C# code sharing across the platformsAndrei Marukovich
 
Microsoft .Net Framework
Microsoft .Net FrameworkMicrosoft .Net Framework
Microsoft .Net FrameworkRohit Rao
 
Net Framework overview
Net Framework overviewNet Framework overview
Net Framework overviewMohitKumar1985
 
Modified.net overview
Modified.net overviewModified.net overview
Modified.net overviewFaisal Aziz
 
DotNet Framework
DotNet FrameworkDotNet Framework
DotNet FrameworkWani Zahoor
 
Automating functional testing of Flex applications.
Automating functional testing of Flex applications.Automating functional testing of Flex applications.
Automating functional testing of Flex applications.Gokuldas Pillai
 
dot net final year project in jalandhar
dot net final year project in jalandhardot net final year project in jalandhar
dot net final year project in jalandhardeepikakaler1
 
Developing a mobile cross-platform library
Developing a mobile cross-platform libraryDeveloping a mobile cross-platform library
Developing a mobile cross-platform libraryKostis Dadamis
 
2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedbackJeff Squyres
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0Antonio Chagoury
 
.NET Standard - Introduction
.NET Standard - Introduction.NET Standard - Introduction
.NET Standard - IntroductionImmo Landwerth
 

Was ist angesagt? (18)

C# code sharing across the platforms
C# code sharing across the platformsC# code sharing across the platforms
C# code sharing across the platforms
 
Microsoft .Net Framework
Microsoft .Net FrameworkMicrosoft .Net Framework
Microsoft .Net Framework
 
Net Framework overview
Net Framework overviewNet Framework overview
Net Framework overview
 
.NET - The Current Spectrum
.NET -  The Current Spectrum.NET -  The Current Spectrum
.NET - The Current Spectrum
 
Modified.net overview
Modified.net overviewModified.net overview
Modified.net overview
 
.NET Framework
.NET Framework.NET Framework
.NET Framework
 
DotNet Framework
DotNet FrameworkDotNet Framework
DotNet Framework
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
Net framework
Net frameworkNet framework
Net framework
 
Automating functional testing of Flex applications.
Automating functional testing of Flex applications.Automating functional testing of Flex applications.
Automating functional testing of Flex applications.
 
.Net Standard 2.0
.Net Standard 2.0.Net Standard 2.0
.Net Standard 2.0
 
dot net final year project in jalandhar
dot net final year project in jalandhardot net final year project in jalandhar
dot net final year project in jalandhar
 
Developing a mobile cross-platform library
Developing a mobile cross-platform libraryDeveloping a mobile cross-platform library
Developing a mobile cross-platform library
 
.Net framework
.Net framework.Net framework
.Net framework
 
Microsoft .Net Technology
Microsoft .Net TechnologyMicrosoft .Net Technology
Microsoft .Net Technology
 
2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
 
.NET Standard - Introduction
.NET Standard - Introduction.NET Standard - Introduction
.NET Standard - Introduction
 

Andere mochten auch

Where is my data (in the cloud) tamir dresher
Where is my data (in the cloud)   tamir dresherWhere is my data (in the cloud)   tamir dresher
Where is my data (in the cloud) tamir dresherTamir Dresher
 
Where Is My Data - ILTAM Session
Where Is My Data - ILTAM SessionWhere Is My Data - ILTAM Session
Where Is My Data - ILTAM SessionTamir Dresher
 
Leveraging Dependency Injection(DI) in Universal Applications - Tamir Dresher
Leveraging Dependency Injection(DI) in Universal Applications -  Tamir DresherLeveraging Dependency Injection(DI) in Universal Applications -  Tamir Dresher
Leveraging Dependency Injection(DI) in Universal Applications - Tamir DresherTamir Dresher
 
Where is my data (in the cloud) tamir dresher
Where is my data (in the cloud)   tamir dresherWhere is my data (in the cloud)   tamir dresher
Where is my data (in the cloud) tamir dresherTamir Dresher
 
Reactiveness All The Way - SW Architecture 2015 Conference
Reactiveness All The Way - SW Architecture 2015 ConferenceReactiveness All The Way - SW Architecture 2015 Conference
Reactiveness All The Way - SW Architecture 2015 ConferenceTamir Dresher
 
Rx 101 - Tamir Dresher - Copenhagen .NET User Group
Rx 101  - Tamir Dresher - Copenhagen .NET User GroupRx 101  - Tamir Dresher - Copenhagen .NET User Group
Rx 101 - Tamir Dresher - Copenhagen .NET User GroupTamir Dresher
 
Debugging tricks you wish you knew - Tamir Dresher
Debugging tricks you wish you knew  - Tamir DresherDebugging tricks you wish you knew  - Tamir Dresher
Debugging tricks you wish you knew - Tamir DresherTamir Dresher
 

Andere mochten auch (7)

Where is my data (in the cloud) tamir dresher
Where is my data (in the cloud)   tamir dresherWhere is my data (in the cloud)   tamir dresher
Where is my data (in the cloud) tamir dresher
 
Where Is My Data - ILTAM Session
Where Is My Data - ILTAM SessionWhere Is My Data - ILTAM Session
Where Is My Data - ILTAM Session
 
Leveraging Dependency Injection(DI) in Universal Applications - Tamir Dresher
Leveraging Dependency Injection(DI) in Universal Applications -  Tamir DresherLeveraging Dependency Injection(DI) in Universal Applications -  Tamir Dresher
Leveraging Dependency Injection(DI) in Universal Applications - Tamir Dresher
 
Where is my data (in the cloud) tamir dresher
Where is my data (in the cloud)   tamir dresherWhere is my data (in the cloud)   tamir dresher
Where is my data (in the cloud) tamir dresher
 
Reactiveness All The Way - SW Architecture 2015 Conference
Reactiveness All The Way - SW Architecture 2015 ConferenceReactiveness All The Way - SW Architecture 2015 Conference
Reactiveness All The Way - SW Architecture 2015 Conference
 
Rx 101 - Tamir Dresher - Copenhagen .NET User Group
Rx 101  - Tamir Dresher - Copenhagen .NET User GroupRx 101  - Tamir Dresher - Copenhagen .NET User Group
Rx 101 - Tamir Dresher - Copenhagen .NET User Group
 
Debugging tricks you wish you knew - Tamir Dresher
Debugging tricks you wish you knew  - Tamir DresherDebugging tricks you wish you knew  - Tamir Dresher
Debugging tricks you wish you knew - Tamir Dresher
 

Ähnlich wie Building apps with common code for windows 8 and windows phone 8 (WP8)

Radu vunvulea building and testing windows 8 metro style applications using ...
Radu vunvulea  building and testing windows 8 metro style applications using ...Radu vunvulea  building and testing windows 8 metro style applications using ...
Radu vunvulea building and testing windows 8 metro style applications using ...Radu Vunvulea
 
dot net technology
dot net technologydot net technology
dot net technologyImran Khan
 
.Net overviewrajnish
.Net overviewrajnish.Net overviewrajnish
.Net overviewrajnishRajnish Kalla
 
Learn the java basic programming with example and syntaxchapter1-part-b.pptx
Learn the java basic programming with example and syntaxchapter1-part-b.pptxLearn the java basic programming with example and syntaxchapter1-part-b.pptx
Learn the java basic programming with example and syntaxchapter1-part-b.pptxGaytriMate
 
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Ken Cenerelli
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele RialdiCodeFest
 
Introduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutionsIntroduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutionsQuontra Solutions
 
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…Lorenz Lo Sauer
 
.Net final year project in jalandhar
.Net final year project in jalandhar.Net final year project in jalandhar
.Net final year project in jalandhardeepikakaler1
 
Dotnet framework
Dotnet frameworkDotnet framework
Dotnet frameworkNitu Pandey
 
.Net overview|Introduction Of .net
.Net overview|Introduction Of .net.Net overview|Introduction Of .net
.Net overview|Introduction Of .netpinky singh
 
Porting tometro
Porting tometroPorting tometro
Porting tometrodogra09
 

Ähnlich wie Building apps with common code for windows 8 and windows phone 8 (WP8) (20)

Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET Framework
 
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu vunvulea  building and testing windows 8 metro style applications using ...Radu vunvulea  building and testing windows 8 metro style applications using ...
Radu vunvulea building and testing windows 8 metro style applications using ...
 
dot net technology
dot net technologydot net technology
dot net technology
 
.Net overviewrajnish
.Net overviewrajnish.Net overviewrajnish
.Net overviewrajnish
 
DOT Net overview
DOT Net overviewDOT Net overview
DOT Net overview
 
Learn the java basic programming with example and syntaxchapter1-part-b.pptx
Learn the java basic programming with example and syntaxchapter1-part-b.pptxLearn the java basic programming with example and syntaxchapter1-part-b.pptx
Learn the java basic programming with example and syntaxchapter1-part-b.pptx
 
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
C# and dot net framework
C# and dot net frameworkC# and dot net framework
C# and dot net framework
 
Introduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutionsIntroduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutions
 
NETOverview1ppt.pptx
NETOverview1ppt.pptxNETOverview1ppt.pptx
NETOverview1ppt.pptx
 
NETOverview1.ppt
NETOverview1.pptNETOverview1.ppt
NETOverview1.ppt
 
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…
 
.Net final year project in jalandhar
.Net final year project in jalandhar.Net final year project in jalandhar
.Net final year project in jalandhar
 
Dotnet framework
Dotnet frameworkDotnet framework
Dotnet framework
 
.Net framework
.Net framework.Net framework
.Net framework
 
VB IMPORTANT QUESTION
VB IMPORTANT QUESTIONVB IMPORTANT QUESTION
VB IMPORTANT QUESTION
 
.Net overview|Introduction Of .net
.Net overview|Introduction Of .net.Net overview|Introduction Of .net
.Net overview|Introduction Of .net
 
Dotnet1
Dotnet1Dotnet1
Dotnet1
 
Porting tometro
Porting tometroPorting tometro
Porting tometro
 

Mehr von Tamir Dresher

NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdfNET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdfTamir Dresher
 
Tamir Dresher - DotNet 7 What's new.pptx
Tamir Dresher - DotNet 7 What's new.pptxTamir Dresher - DotNet 7 What's new.pptx
Tamir Dresher - DotNet 7 What's new.pptxTamir Dresher
 
Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher - What’s new in ASP.NET Core 6Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher - What’s new in ASP.NET Core 6Tamir Dresher
 
Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#Tamir Dresher
 
Anatomy of a data driven architecture - Tamir Dresher
Anatomy of a data driven architecture - Tamir Dresher   Anatomy of a data driven architecture - Tamir Dresher
Anatomy of a data driven architecture - Tamir Dresher Tamir Dresher
 
Tamir Dresher Clarizen adventures with the wild GC during the holiday season
Tamir Dresher   Clarizen adventures with the wild GC during the holiday seasonTamir Dresher   Clarizen adventures with the wild GC during the holiday season
Tamir Dresher Clarizen adventures with the wild GC during the holiday seasonTamir Dresher
 
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019Tamir Dresher
 
From zero to hero with the actor model - Tamir Dresher - Odessa 2019
From zero to hero with the actor model  - Tamir Dresher - Odessa 2019From zero to hero with the actor model  - Tamir Dresher - Odessa 2019
From zero to hero with the actor model - Tamir Dresher - Odessa 2019Tamir Dresher
 
Tamir Dresher - Demystifying the Core of .NET Core
Tamir Dresher  - Demystifying the Core of .NET CoreTamir Dresher  - Demystifying the Core of .NET Core
Tamir Dresher - Demystifying the Core of .NET CoreTamir Dresher
 
Breaking the monolith to microservice with Docker and Kubernetes (k8s)
Breaking the monolith to microservice with Docker and Kubernetes (k8s)Breaking the monolith to microservice with Docker and Kubernetes (k8s)
Breaking the monolith to microservice with Docker and Kubernetes (k8s)Tamir Dresher
 
.Net december 2017 updates - Tamir Dresher
.Net december 2017 updates - Tamir Dresher.Net december 2017 updates - Tamir Dresher
.Net december 2017 updates - Tamir DresherTamir Dresher
 
Testing time and concurrency Rx
Testing time and concurrency RxTesting time and concurrency Rx
Testing time and concurrency RxTamir Dresher
 
Building responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresherBuilding responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresherTamir Dresher
 
.NET Debugging tricks you wish you knew tamir dresher
.NET Debugging tricks you wish you knew   tamir dresher.NET Debugging tricks you wish you knew   tamir dresher
.NET Debugging tricks you wish you knew tamir dresherTamir Dresher
 
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherFrom Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherTamir Dresher
 
Building responsive applications with Rx - CodeMash2017 - Tamir Dresher
Building responsive applications with Rx  - CodeMash2017 - Tamir DresherBuilding responsive applications with Rx  - CodeMash2017 - Tamir Dresher
Building responsive applications with Rx - CodeMash2017 - Tamir DresherTamir Dresher
 
Cloud patterns - NDC Oslo 2016 - Tamir Dresher
Cloud patterns - NDC Oslo 2016 - Tamir DresherCloud patterns - NDC Oslo 2016 - Tamir Dresher
Cloud patterns - NDC Oslo 2016 - Tamir DresherTamir Dresher
 
Rx 101 Codemotion Milan 2015 - Tamir Dresher
Rx 101   Codemotion Milan 2015 - Tamir DresherRx 101   Codemotion Milan 2015 - Tamir Dresher
Rx 101 Codemotion Milan 2015 - Tamir DresherTamir Dresher
 
Azure Cloud Patterns
Azure Cloud PatternsAzure Cloud Patterns
Azure Cloud PatternsTamir Dresher
 
Building services running on Microsoft Azure
Building services running on Microsoft AzureBuilding services running on Microsoft Azure
Building services running on Microsoft AzureTamir Dresher
 

Mehr von Tamir Dresher (20)

NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdfNET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
 
Tamir Dresher - DotNet 7 What's new.pptx
Tamir Dresher - DotNet 7 What's new.pptxTamir Dresher - DotNet 7 What's new.pptx
Tamir Dresher - DotNet 7 What's new.pptx
 
Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher - What’s new in ASP.NET Core 6Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher - What’s new in ASP.NET Core 6
 
Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#
 
Anatomy of a data driven architecture - Tamir Dresher
Anatomy of a data driven architecture - Tamir Dresher   Anatomy of a data driven architecture - Tamir Dresher
Anatomy of a data driven architecture - Tamir Dresher
 
Tamir Dresher Clarizen adventures with the wild GC during the holiday season
Tamir Dresher   Clarizen adventures with the wild GC during the holiday seasonTamir Dresher   Clarizen adventures with the wild GC during the holiday season
Tamir Dresher Clarizen adventures with the wild GC during the holiday season
 
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019
 
From zero to hero with the actor model - Tamir Dresher - Odessa 2019
From zero to hero with the actor model  - Tamir Dresher - Odessa 2019From zero to hero with the actor model  - Tamir Dresher - Odessa 2019
From zero to hero with the actor model - Tamir Dresher - Odessa 2019
 
Tamir Dresher - Demystifying the Core of .NET Core
Tamir Dresher  - Demystifying the Core of .NET CoreTamir Dresher  - Demystifying the Core of .NET Core
Tamir Dresher - Demystifying the Core of .NET Core
 
Breaking the monolith to microservice with Docker and Kubernetes (k8s)
Breaking the monolith to microservice with Docker and Kubernetes (k8s)Breaking the monolith to microservice with Docker and Kubernetes (k8s)
Breaking the monolith to microservice with Docker and Kubernetes (k8s)
 
.Net december 2017 updates - Tamir Dresher
.Net december 2017 updates - Tamir Dresher.Net december 2017 updates - Tamir Dresher
.Net december 2017 updates - Tamir Dresher
 
Testing time and concurrency Rx
Testing time and concurrency RxTesting time and concurrency Rx
Testing time and concurrency Rx
 
Building responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresherBuilding responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresher
 
.NET Debugging tricks you wish you knew tamir dresher
.NET Debugging tricks you wish you knew   tamir dresher.NET Debugging tricks you wish you knew   tamir dresher
.NET Debugging tricks you wish you knew tamir dresher
 
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherFrom Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
 
Building responsive applications with Rx - CodeMash2017 - Tamir Dresher
Building responsive applications with Rx  - CodeMash2017 - Tamir DresherBuilding responsive applications with Rx  - CodeMash2017 - Tamir Dresher
Building responsive applications with Rx - CodeMash2017 - Tamir Dresher
 
Cloud patterns - NDC Oslo 2016 - Tamir Dresher
Cloud patterns - NDC Oslo 2016 - Tamir DresherCloud patterns - NDC Oslo 2016 - Tamir Dresher
Cloud patterns - NDC Oslo 2016 - Tamir Dresher
 
Rx 101 Codemotion Milan 2015 - Tamir Dresher
Rx 101   Codemotion Milan 2015 - Tamir DresherRx 101   Codemotion Milan 2015 - Tamir Dresher
Rx 101 Codemotion Milan 2015 - Tamir Dresher
 
Azure Cloud Patterns
Azure Cloud PatternsAzure Cloud Patterns
Azure Cloud Patterns
 
Building services running on Microsoft Azure
Building services running on Microsoft AzureBuilding services running on Microsoft Azure
Building services running on Microsoft Azure
 

Kürzlich hochgeladen

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Kürzlich hochgeladen (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Building apps with common code for windows 8 and windows phone 8 (WP8)

  • 1. Building Apps with common code for Windows 8 and WP8 Tamir Dresher Senior Software Architect Nov 26, 2013
  • 2. About Me • • • • Software architect, consultant and instructor Technology addict .NET and Native Windows Programming http://www.TamirDresher.com.
  • 3. One step towards convergence - UX • • • • • Tiles Touch interface AppBar Navigation Similar XAML Controls
  • 4. One step towards convergence - Code • Common native API – DirectX, WinSock, CRT, STL and more • WinRT - Infrastructure, common type system, standard programming model. Projected C#, VB, C++ and JavaScript • Shared .NET engine
  • 5. Life is not perfect • There are still parts that doesn’t exist in the other platform – System.Threading.Tasks.Parallel, PLINQ etc. – System.Collections.Concurrent namespace • There are Things that exist but with differences – Dispatcher • There are things that exist but just don’t work
  • 6. WinRT under different platforms Networking Proximity In-App Purchase Sensors Location File System Core app model Threading http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626516(v=vs.105).aspx
  • 8. Common Code between platforms • There are Basically 3 techniques – Link Files – Portable Class Library (PCL) – Dependency Injection
  • 9. Add as Link • Using the same file in multiple projects, without copying the file to each project. • Shared • Not Shared
  • 10. Add as Link • Changes in one immediately reflects in the other • Compilation can change due to Conditionals
  • 11. Demo
  • 12. Add as Link – When To Use • Application logic that is shared but is not portable – each platform has its nuance • Code that is written in WinRT API. • User controls with no platform dependencies (NOT XAML) – You can use conditional compilation in your code-behind class
  • 13. Portable Class Library (PCL) • Portable Class Libraries support a subset of .NET assemblies that target the platforms you choose. • One code -> one project -> one binary for all platforms • Unsupported in VS2012 Express edition
  • 14. Portable Class Library (PCL) • • • • Supports managed code only Doesn’t use conditional compilation related to platform Doesn’t use WinRT API Isn't relevant to UI constructs - XAML code isn’t portable
  • 15.
  • 16. Demo
  • 17. Portable Class Library – When To Use • Shared Managed Code that deals with Logic • Code that doesn’t depends on specific platform API
  • 18. How To Deal with Non-Portable Code • Using the Adapter Pattern PCL ISomeService WP8 Win8 ServiceAdapterWP8 ServiceAdapterWin8 3rdPartyWP8 3rdPartyWin8
  • 19. Sharing UI Code • Separate UI from app logic
  • 20. Summary • • • • • Separate UI from app logic Share your logic in PCL Use Linked Files when necessary (WinRT) Abstract your dependencies and use DI We are on the path for convergence but there is still a long way to go
  • 21. Presenter contact details c: +972-52-4772946 e: tamirdr@codevalue.net b: TamirDresher.com w: www.codevalue.net

Hinweis der Redaktion

  1. UI Consistency
  2. UI Consistency
  3. The set of Windows Runtime API not supported on Windows Phone 8. The API surface area of Windows Runtime is very large, with over 11,000 members. We’ve adopted a subset for Windows Phone 8 that allows you to build compelling phone scenarios. Area 1 in the diagram above represents the APIs that are not available on Windows Phone 8.The set of Windows Runtime API adopted for Windows Phone 8. This is represented by area 2 in the above diagram and consists of approximately 2,800 members. For some types, we have not implemented certain members. For others we have added additional members to support phone-only features. In both cases, these differences are noted in the API reference documentation.We’ve added key APIs needed to build great apps for the phone. These are represented by area 3 in the diagram and total about 600 members. For example, we have brand-new APIs for speech synthesis and recognition, VOIP, and other features. Creating these as Windows Runtime style APIs means you can use them regardless of the programming language you use for your app.
  4. Code that is written in WinRT API. Windows Phone 8 has adopted a subset of Windows Runtime App logic common to both apps, but not portable. In Windows Phone 8 and Windows 8, a lot of infrastructure code, or code that interacts with the operating system or external data sources, can be written using Windows Runtime API. Because Windows Phone 8 has adopted a subset of Windows Runtime, it’s possible to write code that uses this functionality once, and then share it across your apps. For example, both platforms have the same Windows Runtime API for networking, sensors, location, in-app purchase, and proximity. There’s significant overlap in these API on both platforms. This code can’t be placed in a Portable Class Library because it’s not portable. The .NET Framework portable libraries don’t support Windows Runtime. Instead, you can isolate the use of these APIs to classes in your app and share as linked code files in both your Windows Phone 8 and Windows Store app. If you’re using the free, Express versions of Visual Studio, you won’t be able to create Portable Class Libraries. In this case, you should use this code sharing technique to share your app logic. For example, apps that have been built using the Model-View-ViewModel (MVVM) pattern could share the model and viewmodel of you app.User controls with no platform dependencies. Windows Phone 8 and Windows 8 both enable you to create rich user experiences using XAML. They implement this layer differently and have also defined the API in different namespaces. However, this divergence is not insurmountable. In fact, a lot of the functionality, types, and members are named the same between the platforms, and behave the same way. Although the overriding guidance is to build the best user experience as possible for each platform, there may be cases when you can extract elements of your UI that are common to both, write it once, and share with both apps. It isn’t possible to conditionally compile XAML, so the UI that’s defined in a shared user control must be platform independent. You can use conditional compilation in your code-behind class of the user control, so this offers some flexibility.
  5. Doesn’t use Windows Runtime APIs Windows Runtime APIs aren’t portable and can’t be used in a Portable Class Library. There is overlap in the Windows Runtime APIs that are supported on Windows Phone 8 and Windows 8. However, binary compatibility is not supported. Your code has to be compiled for each platform and therefore isn’t suitable for a Portable Class Library. Here too you should abstract the use of Windows Runtime APIs into classes or objects that aren’t shared in a Portable Class Library.Isn't relevant to UI constructs - Although XAML for both platforms looks the same (even same names) this code isn’t portable