SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Ähnlich wie 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 devicesrdresler
 
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.FormsNish Anil
 
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 overviewPruthvi Reddy
 
Developing windows 10 universal apps
Developing windows 10 universal appsDeveloping windows 10 universal apps
Developing windows 10 universal appsTom Walker
 
Visula C# Programming Lecture 1
Visula C# Programming Lecture 1Visula C# Programming Lecture 1
Visula C# Programming Lecture 1Abou Bakr Ashraf
 
Windows Phone 8 Advanced Developers Conference
Windows Phone 8 Advanced Developers ConferenceWindows Phone 8 Advanced Developers Conference
Windows Phone 8 Advanced Developers ConferenceDamir 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 ImprovementsJeff Chu
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming BasicsEueung Mulyana
 
Hybrid App Development with PhoneGap
Hybrid App Development with PhoneGapHybrid App Development with PhoneGap
Hybrid App Development with PhoneGapDotitude
 
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 PhoneSarah 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.pdfLam 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 surveyMounaim Latif
 
Windows 10 UWP Development Overview
Windows 10 UWP Development OverviewWindows 10 UWP Development Overview
Windows 10 UWP Development OverviewDevGAMM Conference
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdfjakjak36
 
Customizing Xamarin.Forms UI
Customizing Xamarin.Forms UICustomizing Xamarin.Forms UI
Customizing Xamarin.Forms UIXamarin
 
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.pptx20TUCS033DHAMODHARAK
 

Ähnlich wie 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
 

Kürzlich hochgeladen

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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech 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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Kürzlich hochgeladen (20)

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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech 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...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

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