SlideShare une entreprise Scribd logo
1  sur  29
Windows Store & Phone Dev
top 10 differences
@dotMorten
Who’s who?
Windows
Phone
Platform of choice
C# since .NET 1.0 beta 2
XAML fulltime since Silverlight v1.1
Work: Building SDKs for
mapping
Silverlight, WPF, Windows
Phone, Windows Store
Hobby:
Same thing but I get to be boss 
Windows 8
WPF
Who’s who #2
What is your preferred coding language?
C#
VB.NET
JavaScript
C++
Other
What platform do you develop most for?
Windows 8
Windows Phone
WPF
Windows Forms
Other
The Inspiration for This Talk
• ArcGIS Runtime SDK for Windows
A Mapping SDK for Windows Phone, Store and Desktop.
Core runtime (C++ & DirectX)
C++ interop
C++/CX WinRT API
C# imports
Public .NET SDK (C#)
Store Phone Desktop
Use Portable Class Library if you can
Pro:
Build, test and compile once.
Con:
Won’t work for UI code
Can’t use non-PCL libraries
No Platform specific code
Use shared source only when you can’t
Pro:
Can always fully use the platform.
Can use non-PCL components
Con:
Likely more testing involved.
Visual Studio gets a little “weird” about it.
More stuff to compile
Or… use them both!
But why share source?
PCL And Shared Source Together
Windows Phone
8
Portable Class Libraries
Windows 8
Services
ViewModels (limited or abstract)
Models
Views (XAML)
App Lifecycle
Navigation
Views (XAML)
Converters
Shared ViewModels (Add as Link)
Storage, Alerts
Platform Specific
Different XAML
Different Controls
Same DataBindings
Same Commands for
Key Interactions
Converters
Quick Code Share Demo
sounds too good to be true?
99% harp
music
It almost is...
At least 99% shared code.
What’s in the remaining 1%?
1% drums
#if NETFX_CORE //Store
#elif WINDOWS_PHONE //Phone
#elif SILVERLIGHT //Silverlight or Phone
#else //WPF/Desktop
#endif
Or combine them:
#if NETFX_CORE || WINDOWS_PHONE
#if !SILVERLIGHT
#if SILVERLIGHT && !WINDOWS_PHONE
Encapsulate platform specific code using
#if [conditional]
1. Namespaces
#if NETFX_CORE
using Windows.UI.Xaml;
#else
using System.Windows;
#endif
Phone / WPF / Silverlight Windows Store
System.Windows Windows.UI.Xaml
System.Windows.Media Windows.UI
System Windows.Foundation*
System
System.Size Windows.Foundation.Size*
System.Windows.Media.Color
Windows.UI.Color
Microsoft.Xna.Framework.Graphics.Color
Windows.UI.Color
Windows Phone/WPF/Silverlight
xmlns:local="clr-namespace:MyNamespace;assembly=MyApp"
Windows Store XAML
xmlns:local="using:MyNamespace"
2. XAML Namespace declaration
3. Touch/Mouse/Pen
Touch is kind of
like a mouse
Everything is
just a pointer
Windows Phone Windows Store
MouseEventHandler => PointerEventHandler
MouseLeftButtonDown => PointerPressed
MouseMove => PointerMoved
MouseEnter/Exit => PointerEntered/Exited
Tap => Tapped
DoubleTap => DoubleTapped
Hold => Holding
3. Touch/Mouse/Pen #2
Windows Phone:
Make web requests using “WebClient”
Install NuGet package “Microsoft.Net.Http”
Windows Store:
Make web requests using “HttpClient”
4. HttpClient vs. WebClient
HttpClient
Use the Dispatcher to call the UI Thread
However they look different...
5. The Dispatcher
Windows Phone
Windows Store:
5. The Dispatcher #2
5. The Dispatcher #3
public class MyViewModel
{
public MyViewModel()
{
if(IsDesign) // <- different on every platform
MyProperty = "Lorem Ipsum";
else
GenerateData();
}
public string MyProperty { get; set; }
…
}
6. Generating Design Time Data
public bool IsDesign
{
get
{
#if NETFX_CORE
return Windows.ApplicationModel.DesignMode.DesignModeEnabled;
#elif SILVERLIGHT // includes WINDOWS_PHONE
return System.ComponentModel.DesignerProperties.IsInDesignTool;
#else //WPF
return
System.ComponentModel.DesignerProperties.GetIsInDesignMode(this);
#endif
}
}
6. Generating Design Time Data
#2
Windows Phone:
this.NavigationService.Navigate(
new Uri("/MyPage.xaml?parameter="+param.ToString(),
UriKind.Relative));
this.NavigationService.Navigate(
new Uri("MyAssembly;component/MyPage.xaml", UriKind.Relative));
Windows Store:
this.Frame.Navigate(typeof(MyPage), param);
7. Page Navigation
Windows Phone:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
string parameter = NavigationContext.QueryString["parameter"];
base.OnNavigatedTo(e);
}
Windows Store:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
object parameter = e.Parameter;
base.OnNavigatedTo(e);
}
7. Page Navigation
GridView  LongListSelector
8. Controls #2
Windows Store
If your app has internet access,
it MUST have a privacy policy!
Windows Phone
If your app uses the location service,
it MUST have an option to disable it!
9. Certification Requirements
10. Where did it go?
Phone Store
Roaming Settings ⛔ 
UI Controls System.Windows Windows.Xaml.UI
Behaviors  ⛔
Remote debugging USB WiFi/LAN
DirectWrite, Direct2D ⛔ 
WritableBitmap.Render  ⛔
RadialBrush  ⛔
XNA
Deprecated
(use DirectX)
⛔
(use DirectX)
LOB Company Hub APIs  ⛔
Binding.StringFormat  ⛔
Native JavaScript Apps ⛔(use PhoneGap) 
Render DirectX to XAML DrawingSurface SurfaceImageSource
References
MSDN Magazine
Sharing Code between Windows Phone 8
and Windows 8 Applications
http://esriurl.com/CodeShare1
TechEd 2013 Session
Build It Once For Both: Writing Code and
Designing for Windows 8 and Windows
Phone 8
http://esriurl.com/CodeShare2
Questions?
Blog (and slides):
www.sharpgis.net
Twitter:
@dotMorten
E-mail:
mnielsen@esri.com
THANK YOU !

Contenu connexe

Tendances

Windows 10 e Universal Windows Platform
Windows 10 e Universal Windows PlatformWindows 10 e Universal Windows Platform
Windows 10 e Universal Windows PlatformAlessio Iafrate
 
Designing and developing a Windows Phone 7 Silverlight Application End-to-End...
Designing and developing a Windows Phone 7 Silverlight Application End-to-End...Designing and developing a Windows Phone 7 Silverlight Application End-to-End...
Designing and developing a Windows Phone 7 Silverlight Application End-to-End...Katrien De Graeve
 
Windows 10 & Raspberry Pi 2
Windows 10 & Raspberry Pi 2Windows 10 & Raspberry Pi 2
Windows 10 & Raspberry Pi 2ByteMinded
 
Introduction to universal windows platform(uwp) app development
Introduction to universal windows platform(uwp) app developmentIntroduction to universal windows platform(uwp) app development
Introduction to universal windows platform(uwp) app developmentThilina Wijerathne
 
01 wp7 introduction
01 wp7   introduction01 wp7   introduction
01 wp7 introductionTao Wang
 
Universal windows platform - Application development done right
Universal windows platform - Application development done rightUniversal windows platform - Application development done right
Universal windows platform - Application development done rightChristos Matskas
 
Windows Phone Apps Development overview
Windows Phone Apps Development overviewWindows Phone Apps Development overview
Windows Phone Apps Development overviewPruthvi Reddy
 
Windows Phone Application Platform
Windows Phone Application PlatformWindows Phone Application Platform
Windows Phone Application PlatformDave Bost
 
Develop a Windows 10 App. Deploy it on PC, Phone and Raspberry Pi.
Develop a Windows 10 App.  Deploy it on PC, Phone and Raspberry Pi.Develop a Windows 10 App.  Deploy it on PC, Phone and Raspberry Pi.
Develop a Windows 10 App. Deploy it on PC, Phone and Raspberry Pi.Clemente Giorio
 
Windowsphone7
Windowsphone7Windowsphone7
Windowsphone7yuvaraj72
 
Dev windows phone_apps_getting_started_guide
Dev windows phone_apps_getting_started_guideDev windows phone_apps_getting_started_guide
Dev windows phone_apps_getting_started_guideTrioBlack Trioblack
 
Windows Phone Programming
Windows Phone ProgrammingWindows Phone Programming
Windows Phone ProgrammingPasi Manninen
 
Deeper into Windows 10 Development
Deeper into Windows 10 DevelopmentDeeper into Windows 10 Development
Deeper into Windows 10 DevelopmentShahed Chowdhuri
 
Universal Apps Oct 2014
Universal Apps Oct 2014Universal Apps Oct 2014
Universal Apps Oct 2014Joe Healy
 

Tendances (20)

Windows 10 e Universal Windows Platform
Windows 10 e Universal Windows PlatformWindows 10 e Universal Windows Platform
Windows 10 e Universal Windows Platform
 
Designing and developing a Windows Phone 7 Silverlight Application End-to-End...
Designing and developing a Windows Phone 7 Silverlight Application End-to-End...Designing and developing a Windows Phone 7 Silverlight Application End-to-End...
Designing and developing a Windows Phone 7 Silverlight Application End-to-End...
 
Windows 10 & Raspberry Pi 2
Windows 10 & Raspberry Pi 2Windows 10 & Raspberry Pi 2
Windows 10 & Raspberry Pi 2
 
Introduction to universal windows platform(uwp) app development
Introduction to universal windows platform(uwp) app developmentIntroduction to universal windows platform(uwp) app development
Introduction to universal windows platform(uwp) app development
 
01 wp7 introduction
01 wp7   introduction01 wp7   introduction
01 wp7 introduction
 
Universal windows platform - Application development done right
Universal windows platform - Application development done rightUniversal windows platform - Application development done right
Universal windows platform - Application development done right
 
Windows Phone Apps Development overview
Windows Phone Apps Development overviewWindows Phone Apps Development overview
Windows Phone Apps Development overview
 
Windows Phone Application Platform
Windows Phone Application PlatformWindows Phone Application Platform
Windows Phone Application Platform
 
Docker for .net developer
Docker for .net developerDocker for .net developer
Docker for .net developer
 
Getting started windows phone unity
Getting started windows phone unityGetting started windows phone unity
Getting started windows phone unity
 
Develop a Windows 10 App. Deploy it on PC, Phone and Raspberry Pi.
Develop a Windows 10 App.  Deploy it on PC, Phone and Raspberry Pi.Develop a Windows 10 App.  Deploy it on PC, Phone and Raspberry Pi.
Develop a Windows 10 App. Deploy it on PC, Phone and Raspberry Pi.
 
Windows 8.1
Windows 8.1Windows 8.1
Windows 8.1
 
Windowsphone7
Windowsphone7Windowsphone7
Windowsphone7
 
Dev windows phone_apps_getting_started_guide
Dev windows phone_apps_getting_started_guideDev windows phone_apps_getting_started_guide
Dev windows phone_apps_getting_started_guide
 
Indie Game Development
Indie Game DevelopmentIndie Game Development
Indie Game Development
 
Ppt on windows 8
Ppt on windows 8Ppt on windows 8
Ppt on windows 8
 
Stc ftn-wp7-intro
Stc ftn-wp7-introStc ftn-wp7-intro
Stc ftn-wp7-intro
 
Windows Phone Programming
Windows Phone ProgrammingWindows Phone Programming
Windows Phone Programming
 
Deeper into Windows 10 Development
Deeper into Windows 10 DevelopmentDeeper into Windows 10 Development
Deeper into Windows 10 Development
 
Universal Apps Oct 2014
Universal Apps Oct 2014Universal Apps Oct 2014
Universal Apps Oct 2014
 

Similaire à Top 10 Differences between developing Windows Phone and Store apps

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
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Doris Chen
 
Mono for Android... for Google Devs
Mono for Android... for Google DevsMono for Android... for Google Devs
Mono for Android... for Google DevsCraig Dunn
 
An introduction to Windows Mobile development
An introduction to Windows Mobile developmentAn introduction to Windows Mobile development
An introduction to Windows Mobile developmentDale Lane
 
Windows 10 pentru dezvoltatori - InfoEducație 2015
Windows 10 pentru dezvoltatori - InfoEducație 2015Windows 10 pentru dezvoltatori - InfoEducație 2015
Windows 10 pentru dezvoltatori - InfoEducație 2015Julian Atanasoae
 
An overview of mobile html + java script frameworks
An overview of mobile html + java script frameworksAn overview of mobile html + java script frameworks
An overview of mobile html + java script frameworksSasha dos Santos
 
Build Your First iPhone or Android App with Telerik AppBuilder
Build Your First iPhone or Android App with Telerik AppBuilderBuild Your First iPhone or Android App with Telerik AppBuilder
Build Your First iPhone or Android App with Telerik AppBuilderJeffrey T. Fritz
 
Customizing Xamarin.Forms UI
Customizing Xamarin.Forms UICustomizing Xamarin.Forms UI
Customizing Xamarin.Forms UIXamarin
 
Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Priyanka Tyagi
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoMamgmo Magnda
 
Xamarin for (not only) Android developers
Xamarin for (not only) Android developersXamarin for (not only) Android developers
Xamarin for (not only) Android developersAleksander Piotrowski
 
Windows phone 7 application development
Windows phone 7 application developmentWindows phone 7 application development
Windows phone 7 application developmentMannu Malhotra
 
Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseJen Looper
 
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ....NET Conf UY
 
Building Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using CordovaBuilding Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using CordovaNoam Kfir
 

Similaire à Top 10 Differences between developing Windows Phone and Store apps (20)

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...
 
Welcome to windows 8
Welcome to windows 8Welcome to windows 8
Welcome to windows 8
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
 
Mono for Android... for Google Devs
Mono for Android... for Google DevsMono for Android... for Google Devs
Mono for Android... for Google Devs
 
An introduction to Windows Mobile development
An introduction to Windows Mobile developmentAn introduction to Windows Mobile development
An introduction to Windows Mobile development
 
Build Recap
Build RecapBuild Recap
Build Recap
 
Windows 10 pentru dezvoltatori - InfoEducație 2015
Windows 10 pentru dezvoltatori - InfoEducație 2015Windows 10 pentru dezvoltatori - InfoEducație 2015
Windows 10 pentru dezvoltatori - InfoEducație 2015
 
An overview of mobile html + java script frameworks
An overview of mobile html + java script frameworksAn overview of mobile html + java script frameworks
An overview of mobile html + java script frameworks
 
Build Your First iPhone or Android App with Telerik AppBuilder
Build Your First iPhone or Android App with Telerik AppBuilderBuild Your First iPhone or Android App with Telerik AppBuilder
Build Your First iPhone or Android App with Telerik AppBuilder
 
C# everywhere
C# everywhereC# everywhere
C# everywhere
 
Customizing Xamarin.Forms UI
Customizing Xamarin.Forms UICustomizing Xamarin.Forms UI
Customizing Xamarin.Forms UI
 
Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul Yao
 
Xamarin for (not only) Android developers
Xamarin for (not only) Android developersXamarin for (not only) Android developers
Xamarin for (not only) Android developers
 
Windows phone 7 application development
Windows phone 7 application developmentWindows phone 7 application development
Windows phone 7 application development
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGap
 
Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and Firebase
 
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
 
An introduction to Xamarin
An introduction to XamarinAn introduction to Xamarin
An introduction to Xamarin
 
Building Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using CordovaBuilding Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using Cordova
 

Dernier

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Dernier (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Top 10 Differences between developing Windows Phone and Store apps

  • 1. Windows Store & Phone Dev top 10 differences @dotMorten
  • 2. Who’s who? Windows Phone Platform of choice C# since .NET 1.0 beta 2 XAML fulltime since Silverlight v1.1 Work: Building SDKs for mapping Silverlight, WPF, Windows Phone, Windows Store Hobby: Same thing but I get to be boss  Windows 8 WPF
  • 3. Who’s who #2 What is your preferred coding language? C# VB.NET JavaScript C++ Other What platform do you develop most for? Windows 8 Windows Phone WPF Windows Forms Other
  • 4. The Inspiration for This Talk • ArcGIS Runtime SDK for Windows A Mapping SDK for Windows Phone, Store and Desktop. Core runtime (C++ & DirectX) C++ interop C++/CX WinRT API C# imports Public .NET SDK (C#) Store Phone Desktop
  • 5. Use Portable Class Library if you can Pro: Build, test and compile once. Con: Won’t work for UI code Can’t use non-PCL libraries No Platform specific code Use shared source only when you can’t Pro: Can always fully use the platform. Can use non-PCL components Con: Likely more testing involved. Visual Studio gets a little “weird” about it. More stuff to compile Or… use them both! But why share source?
  • 6. PCL And Shared Source Together Windows Phone 8 Portable Class Libraries Windows 8 Services ViewModels (limited or abstract) Models Views (XAML) App Lifecycle Navigation Views (XAML) Converters Shared ViewModels (Add as Link) Storage, Alerts Platform Specific Different XAML Different Controls Same DataBindings Same Commands for Key Interactions Converters
  • 8. sounds too good to be true? 99% harp music It almost is... At least 99% shared code. What’s in the remaining 1%? 1% drums
  • 9. #if NETFX_CORE //Store #elif WINDOWS_PHONE //Phone #elif SILVERLIGHT //Silverlight or Phone #else //WPF/Desktop #endif Or combine them: #if NETFX_CORE || WINDOWS_PHONE #if !SILVERLIGHT #if SILVERLIGHT && !WINDOWS_PHONE Encapsulate platform specific code using #if [conditional]
  • 10.
  • 11. 1. Namespaces #if NETFX_CORE using Windows.UI.Xaml; #else using System.Windows; #endif Phone / WPF / Silverlight Windows Store System.Windows Windows.UI.Xaml System.Windows.Media Windows.UI System Windows.Foundation* System System.Size Windows.Foundation.Size* System.Windows.Media.Color Windows.UI.Color Microsoft.Xna.Framework.Graphics.Color Windows.UI.Color
  • 12. Windows Phone/WPF/Silverlight xmlns:local="clr-namespace:MyNamespace;assembly=MyApp" Windows Store XAML xmlns:local="using:MyNamespace" 2. XAML Namespace declaration
  • 13. 3. Touch/Mouse/Pen Touch is kind of like a mouse Everything is just a pointer
  • 14. Windows Phone Windows Store MouseEventHandler => PointerEventHandler MouseLeftButtonDown => PointerPressed MouseMove => PointerMoved MouseEnter/Exit => PointerEntered/Exited Tap => Tapped DoubleTap => DoubleTapped Hold => Holding 3. Touch/Mouse/Pen #2
  • 15. Windows Phone: Make web requests using “WebClient” Install NuGet package “Microsoft.Net.Http” Windows Store: Make web requests using “HttpClient” 4. HttpClient vs. WebClient HttpClient
  • 16. Use the Dispatcher to call the UI Thread However they look different... 5. The Dispatcher
  • 17. Windows Phone Windows Store: 5. The Dispatcher #2
  • 19. public class MyViewModel { public MyViewModel() { if(IsDesign) // <- different on every platform MyProperty = "Lorem Ipsum"; else GenerateData(); } public string MyProperty { get; set; } … } 6. Generating Design Time Data
  • 20. public bool IsDesign { get { #if NETFX_CORE return Windows.ApplicationModel.DesignMode.DesignModeEnabled; #elif SILVERLIGHT // includes WINDOWS_PHONE return System.ComponentModel.DesignerProperties.IsInDesignTool; #else //WPF return System.ComponentModel.DesignerProperties.GetIsInDesignMode(this); #endif } } 6. Generating Design Time Data #2
  • 21. Windows Phone: this.NavigationService.Navigate( new Uri("/MyPage.xaml?parameter="+param.ToString(), UriKind.Relative)); this.NavigationService.Navigate( new Uri("MyAssembly;component/MyPage.xaml", UriKind.Relative)); Windows Store: this.Frame.Navigate(typeof(MyPage), param); 7. Page Navigation
  • 22. Windows Phone: protected override void OnNavigatedTo(NavigationEventArgs e) { string parameter = NavigationContext.QueryString["parameter"]; base.OnNavigatedTo(e); } Windows Store: protected override void OnNavigatedTo(NavigationEventArgs e) { object parameter = e.Parameter; base.OnNavigatedTo(e); } 7. Page Navigation
  • 23.
  • 25. Windows Store If your app has internet access, it MUST have a privacy policy! Windows Phone If your app uses the location service, it MUST have an option to disable it! 9. Certification Requirements
  • 26. 10. Where did it go? Phone Store Roaming Settings ⛔  UI Controls System.Windows Windows.Xaml.UI Behaviors  ⛔ Remote debugging USB WiFi/LAN DirectWrite, Direct2D ⛔  WritableBitmap.Render  ⛔ RadialBrush  ⛔ XNA Deprecated (use DirectX) ⛔ (use DirectX) LOB Company Hub APIs  ⛔ Binding.StringFormat  ⛔ Native JavaScript Apps ⛔(use PhoneGap)  Render DirectX to XAML DrawingSurface SurfaceImageSource
  • 27. References MSDN Magazine Sharing Code between Windows Phone 8 and Windows 8 Applications http://esriurl.com/CodeShare1 TechEd 2013 Session Build It Once For Both: Writing Code and Designing for Windows 8 and Windows Phone 8 http://esriurl.com/CodeShare2

Notes de l'éditeur

  1. System.Windows vs. Windows.UI.Xaml....System.Windows.MarkupWindows.UI.Xaml.MarkupSystem.Windows.MediaWindows.UISystem.SizeWindows.Foundation.SizeSystem.WindowsWindows.FoundationBe careful though:System.Windows.Media.Color vs. Windows.UI.Color: Exists on WP, but comes from WinRT types (+there&apos;s also an XNA version)
  2. Pointers vs. MouseSystem.Windows.Input.MouseEventHandlerWindows.UI.Xaml.Input.PointerEventHandler WP: (Double)Tap, WinStore: (Double)Tapped WP: MouseLeftButtonDown, WinStore: PointerPressed
  3. System.Windows.Input.MouseEventHandlerWindows.UI.Xaml.Input.PointerEventHandler WP: (Double)Tap, WinStore: (Double)Tapped WP: MouseLeftButtonDown, WinStore: PointerPressed
  4. (use NuGet package, but no compression).. Include link to Gzip code + pcl
  5. Switching to Dispatcher threadDispatcher.HasThreadAccessvsCheckAccess(), BeginInvoke, RunAsyncvar dispatcher = System.Windows.Deployment.Current.Dispatcher; var dispatcher = Windows.UI.Xaml.Window.Current.Dispatcher;
  6. WinStoreWindows.ApplicationModel.DesignMode.DesignModeEnabledWinPhoneSystem.ComponentModel.DesignerProperties.IsInDesignTool WPF System.ComponentModel.DesignerProperties.GetIsInDesignMode(UIElement)
  7. WinStoreWindows.ApplicationModel.DesignMode.DesignModeEnabledWinPhoneSystem.ComponentModel.DesignerProperties.IsInDesignTool WPF System.ComponentModel.DesignerProperties.GetIsInDesignMode(UIElement)
  8. Different parameterMultipleFramesBack button vs hooking up backspace.
  9. Different parameterMultipleFramesBack button vs hooking up backspace.
  10. Snap View. Privacy Policy
  11. WinPhone: Roaming settingsWinRT UI Stack Remote Debugging via Wifi No DWrite or Direct2D on WinPhoneWinStore:WriteableBitmap.Render()RadialBrushes XNA LOB Company Hub APIs (was told “Wait for //build/ conference” this week) Rich Binding support Remote debugging via USB (issue with some wifi networks) See article http://www.itwriting.com/blog/6779-how-to-test-and-debug-an-app-on-surface-rt-in-a-hotel-room.html Build apps using JavaScript (PhoneGap for WP if you really want to)Behaviors