SlideShare a Scribd company logo
Windows und
Windows Phone App Entwicklung
Daniel Meixner
Technical Evangelist
Microsoft Deutschland
@DanielMeixner
DevelopersDevelopersDevelopersDevelopers.Net
Agenda
 Platform Convergence
 Windows Universal Apps
 Further code sharing strategies
People work across phones, tablets, and PCs
Programming skills
Development tools
Languages, frameworks
Components
Runtimes
Platform convergence is a jouney.
unified experience
multiple devices
minimum work
Introducing universal Windows apps
Streamlined end-to-end development
User Interface App Model Tools StoreAPIs
You can adapt one design across devices
User Interface App Model Tools StoreAPIs
You can tailor the design to each device
User Interface App Model Tools StoreAPIs
13
80% exact same XAML 20% custom
Common SignatureOptimized
DatePicker
TimePicker
CommandBar
AppBar
Button
CheckBox
RadioButton ProgressBar
Slider
ToggleSwitch
Hub
Pivot
ListView
GridView
User Interface App Model Tools StoreAPIs
App Model APIs
Develop your app in a way that’s familiar
User Interface Tools Store
HTML / CSS
JavaScript
Windows Runtime
C# / VB
Windows Kernel Services
C / C++
XAML DirectX
The Windows Runtime (WinRT) is the
shared runtime and API space used by
store apps across the Windows platform
(phone and client)
Dramatic convergence in 8.1
• Goal is 100% convergence for dev scenarios
• In 8.0, we had ~30% API convergence
• With 8.1, we move well past 90%+ convergence
App Model APIsUser Interface Tools Store
Tools
Write and debug your code with ease
User Interface App Model StoreAPIs
You can let customers buy once, use anywhere
Store
Made for Windows Phones
and Windows PCs
User Interface App Model ToolsAPIs
18
| |
Legend
Overall Strategy
Embrace & separate
differences
Separate View
(MVVM)
Separate
platform
specific calls
(Libs)
Try to share everything
else
Let‘s see...
Reuse: Portable Class Library
Reusing pre-built components or libraries
7/16/2014Microsoft
confidential
2
2
• Portable Class Library
• Managed Code
• Reusable library
• New:
• Supports XAML
• Supports Windows.* Namespace
Portable Class Library
Windows Phone
Silverlight
.NET Framework 4.5
.NET for Windows
Store Apps
Shared Code: File-Level (Add as Link)
• App logic common to both apps, but not
portable
• Code containing Windows Runtime API calls
• Share outside of Universal Apps
Shared Code: Classpart-Level
(Partial Classes)
public partial class MyClass
{
public void CommonMethodA()
{
// code that is common
}
public int CommonMethodB()
{
int result = 0;
// code that is common
return result;
}
}
public partial class MyClass
{
public void PlatformSpecificMethod()
{
// specific code for platform Á
}
}
}
public partial class MyClass
{
public void PlatformSpecificMethod()
{
// specific code for platform B
}
}
Shared Code: Line Level (Conditional Compilation)
public class MyClass
{
public void CommonMethodA()
{
// code that is common to Windows Phone 8 and Windows 8
}
public int CommonMethodB()
{
int result = 0;
// code that is common to Windows Phone 8 and Windows 8
return result;
}
public void PlatformSpecificMethod()
{
#if WINDOWS_APP
// code for W8.1
#else
// …
#endif
}
}
public class MyWin8Class : MyBaseClass
{
public override void PlatformSpecificMethod()
{
// Implement this method specific to Win 8
}
} }
Patterns: Abstract Base Class
public abstract class MyBaseClass
{
public void CommonMethodA()
{
// code that is common
}
public int CommonMethodB()
{
int result = 0;
// code that is common
return result;
}
public abstract void PlatformSpecificMethod();
}
Add as Link /
Shared Folder
Portable Class Library
public class MyWP8Class : MyBaseClass
{
public override void PlatformSpecificMethod()
{
// Implement this method specific to WP8
}
}
public class MyClass
{
private IPlatformSpecificCode _platformImpl;
public MyClass(IPlatformSpecificCode platformImpl)
{
_platformImpl = platformImpl;
}
public void CommonMethodA()
{ ... }
public int CommonMethodB()
{ ... }
public void PlatformSpecificMethod()
{
_platformImpl.PlatformSpecificMethodImpl();
}
}
public interface IPlatformSpecificCode
{
void PlatformSpecificMethodImpl();
}
// Windows 8 app project
public class MyWin8Implementation : IPlatformSpecificCode
{
public void PlatformSpecificMethod()
{
// Implemented for Windows 8
}
}
Patterns: Interfaces & DI
// Windows Phone app project
public class MyWinPhone 8Implementation : IPlatformSpecificCode
{
public void PlatformSpecificMethod()
{
// Implemented for Windows Phone 8
}
}
Dirty Tricks Vol.1: Delegates
Dirty Tricks Vol.2: Up-Casting & Down-Casting to
object
Not so dirty Trick: Extension Methods
Windows 8:
HttpWebResponse.GetResponseAsync()
Windows Phone 8:
HttpWebResponse.GetResponseAsync()
Demo
Share what you can share.
Don‘t share what you can‘t share.
What do you want to share today?
Microsoft
Azure
Store Registration, Purchasing
Push Notifications …
Universal App Sync
Universal App
Visual Studio
Summary
 Building for both WP8.1 & WP8.1 is easy
 Universal Apps are flexible
 Alernative ways to share code exist
 More to come … stay tuned!
Daniel Meixner
Technical Evangelist
Microsoft Deutschland
@DanielMeixner
DevelopersDevelopersDevelopersDevelopers.Net
Q&A

More Related Content

Similar to Windows und Windows Phone App Entwicklung (Daniel Meixner, DWX 2014)

Apps development for mobile devices
Apps development for mobile devicesApps development for mobile devices
Apps development for mobile devices
rdresler
 
APAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsAPAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.Forms
Nish Anil
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
Revanth Mca
 
Iasi 15 noiembrie 2009 Introduction to Windows Mobile programming
Iasi  15 noiembrie 2009   Introduction to Windows Mobile programmingIasi  15 noiembrie 2009   Introduction to Windows Mobile programming
Iasi 15 noiembrie 2009 Introduction to Windows Mobile programmingCatalin Gheorghiu
 
Windows Phone Apps Development overview
Windows Phone Apps Development overviewWindows Phone Apps Development overview
Windows Phone Apps Development overview
Pruthvi Reddy
 
Developing windows 10 universal apps
Developing windows 10 universal appsDeveloping windows 10 universal apps
Developing windows 10 universal apps
Tom Walker
 
Visula C# Programming Lecture 1
Visula C# Programming Lecture 1Visula C# Programming Lecture 1
Visula C# Programming Lecture 1
Abou Bakr Ashraf
 
Windows Phone 8 Advanced Developers Conference
Windows Phone 8 Advanced Developers ConferenceWindows Phone 8 Advanced Developers Conference
Windows Phone 8 Advanced Developers Conference
Damir Dobric
 
Adc2012 windows phone 8
Adc2012 windows phone 8Adc2012 windows phone 8
Adc2012 windows phone 8AlexanderGoetz
 
.NET Innovations and Improvements
.NET Innovations and Improvements.NET Innovations and Improvements
.NET Innovations and Improvements
Jeff Chu
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
Eueung Mulyana
 
Hybrid App Development with PhoneGap
Hybrid App Development with PhoneGapHybrid App Development with PhoneGap
Hybrid App Development with PhoneGap
Dotitude
 
Three's Company - Writing for the Desktop, Browser, and Phone
Three's Company - Writing for the Desktop, Browser, and PhoneThree's Company - Writing for the Desktop, Browser, and Phone
Three's Company - Writing for the Desktop, Browser, and Phone
Sarah Dutkiewicz
 
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
TK2323 Lecture 1 - Introduction to Mobile Application.pdfTK2323 Lecture 1 - Introduction to Mobile Application.pdf
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
Lam Chun
 
Cross platform approach for mobile application development : a survey
Cross platform approach for mobile application development : a surveyCross platform approach for mobile application development : a survey
Cross platform approach for mobile application development : a survey
Mounaim Latif
 
Windows 10 UWP Development Overview
Windows 10 UWP Development OverviewWindows 10 UWP Development Overview
Windows 10 UWP Development Overview
DevGAMM Conference
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdf
jakjak36
 
Customizing Xamarin.Forms UI
Customizing Xamarin.Forms UICustomizing Xamarin.Forms UI
Customizing Xamarin.Forms UI
Xamarin
 
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...Jason Conger
 
INTRODUCTION TO FLUTTER BASICS.pptx
INTRODUCTION TO FLUTTER BASICS.pptxINTRODUCTION TO FLUTTER BASICS.pptx
INTRODUCTION TO FLUTTER BASICS.pptx
20TUCS033DHAMODHARAK
 

Similar to Windows und Windows Phone App Entwicklung (Daniel Meixner, DWX 2014) (20)

Apps development for mobile devices
Apps development for mobile devicesApps development for mobile devices
Apps development for mobile devices
 
APAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsAPAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.Forms
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
 
Iasi 15 noiembrie 2009 Introduction to Windows Mobile programming
Iasi  15 noiembrie 2009   Introduction to Windows Mobile programmingIasi  15 noiembrie 2009   Introduction to Windows Mobile programming
Iasi 15 noiembrie 2009 Introduction to Windows Mobile programming
 
Windows Phone Apps Development overview
Windows Phone Apps Development overviewWindows Phone Apps Development overview
Windows Phone Apps Development overview
 
Developing windows 10 universal apps
Developing windows 10 universal appsDeveloping windows 10 universal apps
Developing windows 10 universal apps
 
Visula C# Programming Lecture 1
Visula C# Programming Lecture 1Visula C# Programming Lecture 1
Visula C# Programming Lecture 1
 
Windows Phone 8 Advanced Developers Conference
Windows Phone 8 Advanced Developers ConferenceWindows Phone 8 Advanced Developers Conference
Windows Phone 8 Advanced Developers Conference
 
Adc2012 windows phone 8
Adc2012 windows phone 8Adc2012 windows phone 8
Adc2012 windows phone 8
 
.NET Innovations and Improvements
.NET Innovations and Improvements.NET Innovations and Improvements
.NET Innovations and Improvements
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
 
Hybrid App Development with PhoneGap
Hybrid App Development with PhoneGapHybrid App Development with PhoneGap
Hybrid App Development with PhoneGap
 
Three's Company - Writing for the Desktop, Browser, and Phone
Three's Company - Writing for the Desktop, Browser, and PhoneThree's Company - Writing for the Desktop, Browser, and Phone
Three's Company - Writing for the Desktop, Browser, and Phone
 
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
TK2323 Lecture 1 - Introduction to Mobile Application.pdfTK2323 Lecture 1 - Introduction to Mobile Application.pdf
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
 
Cross platform approach for mobile application development : a survey
Cross platform approach for mobile application development : a surveyCross platform approach for mobile application development : a survey
Cross platform approach for mobile application development : a survey
 
Windows 10 UWP Development Overview
Windows 10 UWP Development OverviewWindows 10 UWP Development Overview
Windows 10 UWP Development Overview
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdf
 
Customizing Xamarin.Forms UI
Customizing Xamarin.Forms UICustomizing Xamarin.Forms UI
Customizing Xamarin.Forms UI
 
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
 
INTRODUCTION TO FLUTTER BASICS.pptx
INTRODUCTION TO FLUTTER BASICS.pptxINTRODUCTION TO FLUTTER BASICS.pptx
INTRODUCTION TO FLUTTER BASICS.pptx
 

Recently uploaded

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 

Recently uploaded (20)

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 

Windows und Windows Phone App Entwicklung (Daniel Meixner, DWX 2014)

  • 1. Windows und Windows Phone App Entwicklung Daniel Meixner Technical Evangelist Microsoft Deutschland @DanielMeixner DevelopersDevelopersDevelopersDevelopers.Net
  • 2. Agenda  Platform Convergence  Windows Universal Apps  Further code sharing strategies
  • 3.
  • 4. People work across phones, tablets, and PCs
  • 5. Programming skills Development tools Languages, frameworks Components Runtimes
  • 7.
  • 10. Streamlined end-to-end development User Interface App Model Tools StoreAPIs
  • 11. You can adapt one design across devices User Interface App Model Tools StoreAPIs
  • 12. You can tailor the design to each device User Interface App Model Tools StoreAPIs
  • 13. 13 80% exact same XAML 20% custom Common SignatureOptimized DatePicker TimePicker CommandBar AppBar Button CheckBox RadioButton ProgressBar Slider ToggleSwitch Hub Pivot ListView GridView User Interface App Model Tools StoreAPIs
  • 14. App Model APIs Develop your app in a way that’s familiar User Interface Tools Store HTML / CSS JavaScript Windows Runtime C# / VB Windows Kernel Services C / C++ XAML DirectX
  • 15. The Windows Runtime (WinRT) is the shared runtime and API space used by store apps across the Windows platform (phone and client) Dramatic convergence in 8.1 • Goal is 100% convergence for dev scenarios • In 8.0, we had ~30% API convergence • With 8.1, we move well past 90%+ convergence App Model APIsUser Interface Tools Store
  • 16. Tools Write and debug your code with ease User Interface App Model StoreAPIs
  • 17. You can let customers buy once, use anywhere Store Made for Windows Phones and Windows PCs User Interface App Model ToolsAPIs
  • 19.
  • 20.
  • 21. Overall Strategy Embrace & separate differences Separate View (MVVM) Separate platform specific calls (Libs) Try to share everything else Let‘s see...
  • 22. Reuse: Portable Class Library Reusing pre-built components or libraries 7/16/2014Microsoft confidential 2 2 • Portable Class Library • Managed Code • Reusable library • New: • Supports XAML • Supports Windows.* Namespace
  • 23. Portable Class Library Windows Phone Silverlight .NET Framework 4.5 .NET for Windows Store Apps
  • 24. Shared Code: File-Level (Add as Link) • App logic common to both apps, but not portable • Code containing Windows Runtime API calls • Share outside of Universal Apps
  • 25. Shared Code: Classpart-Level (Partial Classes) public partial class MyClass { public void CommonMethodA() { // code that is common } public int CommonMethodB() { int result = 0; // code that is common return result; } } public partial class MyClass { public void PlatformSpecificMethod() { // specific code for platform Á } } } public partial class MyClass { public void PlatformSpecificMethod() { // specific code for platform B } }
  • 26. Shared Code: Line Level (Conditional Compilation) public class MyClass { public void CommonMethodA() { // code that is common to Windows Phone 8 and Windows 8 } public int CommonMethodB() { int result = 0; // code that is common to Windows Phone 8 and Windows 8 return result; } public void PlatformSpecificMethod() { #if WINDOWS_APP // code for W8.1 #else // … #endif } }
  • 27. public class MyWin8Class : MyBaseClass { public override void PlatformSpecificMethod() { // Implement this method specific to Win 8 } } } Patterns: Abstract Base Class public abstract class MyBaseClass { public void CommonMethodA() { // code that is common } public int CommonMethodB() { int result = 0; // code that is common return result; } public abstract void PlatformSpecificMethod(); } Add as Link / Shared Folder Portable Class Library public class MyWP8Class : MyBaseClass { public override void PlatformSpecificMethod() { // Implement this method specific to WP8 } }
  • 28. public class MyClass { private IPlatformSpecificCode _platformImpl; public MyClass(IPlatformSpecificCode platformImpl) { _platformImpl = platformImpl; } public void CommonMethodA() { ... } public int CommonMethodB() { ... } public void PlatformSpecificMethod() { _platformImpl.PlatformSpecificMethodImpl(); } } public interface IPlatformSpecificCode { void PlatformSpecificMethodImpl(); } // Windows 8 app project public class MyWin8Implementation : IPlatformSpecificCode { public void PlatformSpecificMethod() { // Implemented for Windows 8 } } Patterns: Interfaces & DI // Windows Phone app project public class MyWinPhone 8Implementation : IPlatformSpecificCode { public void PlatformSpecificMethod() { // Implemented for Windows Phone 8 } }
  • 29. Dirty Tricks Vol.1: Delegates
  • 30. Dirty Tricks Vol.2: Up-Casting & Down-Casting to object
  • 31. Not so dirty Trick: Extension Methods Windows 8: HttpWebResponse.GetResponseAsync() Windows Phone 8: HttpWebResponse.GetResponseAsync()
  • 32. Demo
  • 33. Share what you can share. Don‘t share what you can‘t share.
  • 34. What do you want to share today? Microsoft Azure Store Registration, Purchasing Push Notifications … Universal App Sync Universal App Visual Studio
  • 35. Summary  Building for both WP8.1 & WP8.1 is easy  Universal Apps are flexible  Alernative ways to share code exist  More to come … stay tuned!
  • 36. Daniel Meixner Technical Evangelist Microsoft Deutschland @DanielMeixner DevelopersDevelopersDevelopersDevelopers.Net Q&A