SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Consulting/Training
WinRT and the Web: Keeping
Windows Store Apps Alive and
Connected
Consulting/Training
consulting
Wintellect helps you build better software,
faster, tackling the tough projects and solving
the software and technology questions that
help you transform your business.
 Architecture, Analysis and Design
 Full lifecycle software development
 Debugging and Performance tuning
 Database design and development
training
Wintellect's courses are written and taught by
some of the biggest and most respected names
in the Microsoft programming industry.
 Learn from the best. Access the same
training Microsoft’s developers enjoy
 Real world knowledge and solutions on
both current and cutting edge
technologies
 Flexibility in training options – onsite,
virtual, on demand
Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins – we pull
out all the stops to help our customers achieve their goals through advanced software-based
consulting and training solutions.
who we are
About Wintellect
Consulting/Training
Building Windows 8 Apps
http://bit.ly/win8design
“Getting Started Guide”
For the more in depth
“experts guide” wait for
WinRT by Example in
early 2014
Consulting/Training
 WinRT and .NET (and a note about Windows 8.1)
 WebView
 Simple: HTTP (REST)
 OData (WCF Data Services)
 Syndication
 SOAP
 WAMS
Agenda
Consulting/Training
 Most .NET network classes are
available to WinRT
 Some are being moved into WinRT (i.e.
the HttpClient)
 Others are proxies and generate pure
.NET code as a function of the IDE
 We’ll focus on C# but the WinRT
components are valid for C++ and
JavaScript too
WinRT and .NET
Consulting/Training
 Internet Explorer 10 (11 in 8.1) control
 In 8.1 it uses a Direct Composition surface
so it can be translated/transformed and
overlaid, in 8.0 – er, ouch, wait for 8.1
 Capable of rendering SVG and in 8.1
WebGL
 Interoperability with the Windows Store
app (can call to scripts on the page and
vice versa)
 Navigation methods (history, journal)
built-in
WebView Control
Consulting/Training
this.WebViewControl.Navigate(new Uri(JeremyBlog));
this.WebViewControl.Navigate(new
Uri("ms-appx-web:///Data/Ellipse.html"));
// can also navigate to streams with a special URI handler in 8.1
this.WebViewControl.NavigateToString(HtmlFragment);
var parameters = new[] { "p/biography.html" };
this.WebViewControl.InvokeScript(
"superSecretBiographyFunction",
parameters);
WebView Control
Consulting/Training
The Embedded Browser: Using WebView
Consulting/Training
 .NET for 8.0, WinRT for 8.1
 Pure control over HTTP
 Viable for REST i.e. serialize/deserialize
directly from JSON and/or XML
 Control headers and manage response
as text, stream, etc.
 GET, POST, PUT, and DELETE
 Using HttpRequestMessage for custom
verbs, etc.
 Base class for more specialized clients
HttpClient
Consulting/Training
private static readonly MediaTypeWithQualityHeaderValue Json = new
MediaTypeWithQualityHeaderValue("application/json");
string jsonResponse;
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Accept.Add(Json);
jsonResponse = await client.GetStringAsync(productsUri);
}
var json = JsonObject.Parse(jsonResponse);
HttpClient (and a little JSON help)
Consulting/Training
Parsing a REST service with HttpClient and JSON
Consulting/Training
 http://msdn.microsoft.com/en-
us/jj658961
 Add-on for Visual Studio 2012
 Allows right-click and add
reference for service
 Generates the proxy and
structures using a data context
(similar to Entity Framework /
WCF RIA)
OData (WCF Services)
Consulting/Training
OData (WCF Data Services)
Consulting/Training
ServiceBase = new Uri("http://services.odata.org/OData/OData.svc",
UriKind.Absolute);
var client = new ODataService.DemoService(ServiceBase);
var categoryQuery = client.Categories.AddQueryOption("$expand",
"Products");
var categories = await Task<IEnumerable<ODataService.Category>>
.Factory.FromAsync(
categoryQuery.BeginExecute(result => { }, client),
categoryQuery.EndExecute);
OData Client Proxy
Consulting/Training
Connecting to OData using WCF Data Services
Consulting/Training
 WinRT (mirrors the .NET equivalent
very closely)
 Parses Atom and RSS
 Suitable for both consuming and
publishing
 Also capable of converting
between formats (i.e. read an Atom
and serve an RSS)
Syndication (Atom/RSS)
Consulting/Training
private static readonly Uri CSharperImageUri = new Uri(
"http://feeds.feedburner.com/CSharperImage/", UriKind.Absolute);
var client = new SyndicationClient();
var feed = await client.RetrieveFeedAsync(CSharperImageUri);
var group = new DataFeed(feed.Id, feed.Title.Text, AuthorSignature,
feed.ImageUri.ToString(), feed.Subtitle.Text);
from item in feed.Items
let content =
Windows.Data.Html.HtmlUtilities.ConvertToText(item.Content.Text)
let summary = string.Format("{0} ...", content.Length > 255 ?
content.Substring(0, 255) : content)
Feed Syndication
Consulting/Training
Syndicating a Feed
Consulting/Training
 IDE provides similar interface to OData
 Uses WSDL to understand the shape of the service
 Considered a more complicated protocol but is
very widely used and has built-in security,
encryption, and other features that are beneficial
to the enterprise
 Generates a proxy (client) that is used to handle
the communications (RPC-based)
 Can also use channel factories to create clients
SOAP
Consulting/Training
SOAP
Consulting/Training
var proxy = new WeatherSoapClient();
var result = await proxy.GetWeatherInformationAsync();
foreach (var item in result.GetWeatherInformationResult)
{
this.weather.Add(item);
}
SOAP Proxy (Generated Client)
Consulting/Training
using (
var factory = new ChannelFactory<WeatherSoapChannel>(
new BasicHttpBinding(), new
EndpointAddress("http://wsf.cdyne.com/WeatherWS/Weather.asmx")))
{
var channel = factory.CreateChannel();
var forecast = await channel.GetCityForecastByZIPAsync(zipCode);
var result = forecast.AsWeatherForecast();
foreach (var day in result.Forecast)
{
day.ForecastUri = await this.GetImageUriForType(day.TypeId);
}
return result;
}
SOAP Proxy (Channel Factory)
Consulting/Training
Connecting to SOAP-based Web Services
Consulting/Training
 Affectionately referred to as WAMS
 Sample project generated by site; in Windows
8.1 it is literally right-click and “add Windows
Push Notification Service”
 Create simple CRUD and other types of services
using hosted SQL
 Create push notifications for live updates and
notifications within your app
Windows Azure Mobile Services
Consulting/Training
Windows Azure Mobile Services
Consulting/Training
Windows Azure Mobile Services
Consulting/Training
public static MobileServiceClient MobileService =
new MobileServiceClient(
"https://winrtbyexample.azure-mobile.net/",
"ThisIsASecretAndWillLookDifferentForYou"
);
private IMobileServiceTable<TodoItem> todoTable
= App.MobileService.GetTable<TodoItem>();
var results = await todoTable
.Where(todoItem => todoItem.Complete == false)
.ToListAsync();
items = new ObservableCollection<TodoItem>(results);
ListItems.ItemsSource = items;
Windows Azure Mobile Services
Consulting/Training
Tiles and Notifications
Consulting/Training
 WebView
 Simple: HTTP (REST)
 OData (WCF Data Services)
 Syndication
 SOAP
 WAMS
 Tiles and Notifications
 All source code:
http://winrtexamples.codeplex.com
Recap
Consulting/Training
Subscribers Enjoy
 Expert Instructors
 Quality Content
 Practical Application
 All Devices
Wintellect’s On-Demand
Video Training Solution
Individuals | Businesses | Enterprise Organizations
WintellectNOW.com
Authors Enjoy
 Royalty Income
 Personal Branding
 Free Library Access
 Cross-Sell
Opportunities
Try It Free!
Use Promo Code:
LIKNESS-13
Consulting/Training
Questions?
jlikness@Wintellect.com

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (18)

Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Mvc4
Mvc4Mvc4
Mvc4
 
Build Apps Using Dynamic Languages
Build Apps Using Dynamic LanguagesBuild Apps Using Dynamic Languages
Build Apps Using Dynamic Languages
 
Cakephp
CakephpCakephp
Cakephp
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
 
Integrated Proposal (Vsts Sps Tfs) - MS stack
Integrated Proposal   (Vsts Sps Tfs) - MS stackIntegrated Proposal   (Vsts Sps Tfs) - MS stack
Integrated Proposal (Vsts Sps Tfs) - MS stack
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
Jsf
JsfJsf
Jsf
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Weblogic deployment
Weblogic deploymentWeblogic deployment
Weblogic deployment
 
SP2010 Developer Tools
SP2010 Developer ToolsSP2010 Developer Tools
SP2010 Developer Tools
 
Membangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.jsMembangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.js
 
Spring - Part 4 - Spring MVC
Spring - Part 4 - Spring MVCSpring - Part 4 - Spring MVC
Spring - Part 4 - Spring MVC
 
Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013
 
Development Session
Development SessionDevelopment Session
Development Session
 
Codeigniter Introduction
Codeigniter IntroductionCodeigniter Introduction
Codeigniter Introduction
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
Spring Framework -I
Spring Framework -ISpring Framework -I
Spring Framework -I
 

Andere mochten auch

Vow vioces of women 15 march 2015
Vow vioces of women 15 march 2015Vow vioces of women 15 march 2015
Vow vioces of women 15 march 2015
VIBHUTI PATEL
 
Pricing and Marketing for Freelancers - How to?
Pricing and Marketing for Freelancers - How to?Pricing and Marketing for Freelancers - How to?
Pricing and Marketing for Freelancers - How to?
Brian Hogg
 
Success with informational texts.pptx
Success with informational texts.pptxSuccess with informational texts.pptx
Success with informational texts.pptx
jsmalcolm
 
2012 Profession Portfolio of Allen J Cochran
2012 Profession Portfolio of Allen J Cochran2012 Profession Portfolio of Allen J Cochran
2012 Profession Portfolio of Allen J Cochran
Allen Cochran
 
Intro to inbound marketing
Intro to inbound marketingIntro to inbound marketing
Intro to inbound marketing
Gaël Breton
 
Women related issues and gender budgeting in ul bs 14 7-2015
Women related issues and gender budgeting in ul bs  14 7-2015Women related issues and gender budgeting in ul bs  14 7-2015
Women related issues and gender budgeting in ul bs 14 7-2015
VIBHUTI PATEL
 

Andere mochten auch (16)

Janata july 5 2015
Janata july 5 2015Janata july 5 2015
Janata july 5 2015
 
Home heating Energy Saving Ideas
Home heating Energy Saving IdeasHome heating Energy Saving Ideas
Home heating Energy Saving Ideas
 
Vow vioces of women 15 march 2015
Vow vioces of women 15 march 2015Vow vioces of women 15 march 2015
Vow vioces of women 15 march 2015
 
Web security
Web securityWeb security
Web security
 
Pricing and Marketing for Freelancers - How to?
Pricing and Marketing for Freelancers - How to?Pricing and Marketing for Freelancers - How to?
Pricing and Marketing for Freelancers - How to?
 
Vibhuti patel on a long battle for girl child epw 21 5-2001
Vibhuti patel on a long battle for girl child epw 21 5-2001Vibhuti patel on a long battle for girl child epw 21 5-2001
Vibhuti patel on a long battle for girl child epw 21 5-2001
 
WORLD WATCH 2013 - check in now.
WORLD WATCH 2013 - check in now.WORLD WATCH 2013 - check in now.
WORLD WATCH 2013 - check in now.
 
Gee reception
Gee receptionGee reception
Gee reception
 
Sterling for Windows Phone 7
Sterling for Windows Phone 7Sterling for Windows Phone 7
Sterling for Windows Phone 7
 
Union Budget 2015 16 through Gender Lens by Prof. Vibuti Patel 8-3-2015 esoci...
Union Budget 2015 16 through Gender Lens by Prof. Vibuti Patel 8-3-2015 esoci...Union Budget 2015 16 through Gender Lens by Prof. Vibuti Patel 8-3-2015 esoci...
Union Budget 2015 16 through Gender Lens by Prof. Vibuti Patel 8-3-2015 esoci...
 
Success with informational texts.pptx
Success with informational texts.pptxSuccess with informational texts.pptx
Success with informational texts.pptx
 
2012 Profession Portfolio of Allen J Cochran
2012 Profession Portfolio of Allen J Cochran2012 Profession Portfolio of Allen J Cochran
2012 Profession Portfolio of Allen J Cochran
 
Intro to inbound marketing
Intro to inbound marketingIntro to inbound marketing
Intro to inbound marketing
 
Women related issues and gender budgeting in ul bs 14 7-2015
Women related issues and gender budgeting in ul bs  14 7-2015Women related issues and gender budgeting in ul bs  14 7-2015
Women related issues and gender budgeting in ul bs 14 7-2015
 
OpenSpan for HealthCare: Four Member Service Representative Readiness Strateg...
OpenSpan for HealthCare: Four Member Service Representative Readiness Strateg...OpenSpan for HealthCare: Four Member Service Representative Readiness Strateg...
OpenSpan for HealthCare: Four Member Service Representative Readiness Strateg...
 
Surviving Financial Distress1
Surviving Financial Distress1Surviving Financial Distress1
Surviving Financial Distress1
 

Ähnlich wie WinRT and the Web: Keeping Windows Store Apps Alive and Connected

D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
Sunil Patil
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
Sunil Patil
 
Satendra Gupta Sr DotNet Consultant
Satendra Gupta Sr  DotNet ConsultantSatendra Gupta Sr  DotNet Consultant
Satendra Gupta Sr DotNet Consultant
SATENDRA GUPTA
 

Ähnlich wie WinRT and the Web: Keeping Windows Store Apps Alive and Connected (20)

Angular JS Basics
Angular JS BasicsAngular JS Basics
Angular JS Basics
 
Vijay Oscon
Vijay OsconVijay Oscon
Vijay Oscon
 
Tech Lead-Sachidanand Sharma
Tech Lead-Sachidanand SharmaTech Lead-Sachidanand Sharma
Tech Lead-Sachidanand Sharma
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
 
Online test management system
Online test management systemOnline test management system
Online test management system
 
Getting Started with API Management
Getting Started with API ManagementGetting Started with API Management
Getting Started with API Management
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
 
2014 q3-platform-update-v1.06.johnmathon
2014 q3-platform-update-v1.06.johnmathon2014 q3-platform-update-v1.06.johnmathon
2014 q3-platform-update-v1.06.johnmathon
 
Actively looking for an opportunity to work as a challenging Dot Net Developer
Actively looking for an opportunity to work as a challenging Dot Net DeveloperActively looking for an opportunity to work as a challenging Dot Net Developer
Actively looking for an opportunity to work as a challenging Dot Net Developer
 
Actively looking for an opportunity to work as a challenging Dot Net Developer
Actively looking for an opportunity to work as a challenging Dot Net DeveloperActively looking for an opportunity to work as a challenging Dot Net Developer
Actively looking for an opportunity to work as a challenging Dot Net Developer
 
ASP.NET OVERVIEW
ASP.NET OVERVIEWASP.NET OVERVIEW
ASP.NET OVERVIEW
 
Chris Durkin Resume - Expert .NET Consultant 18 years experience
Chris Durkin Resume - Expert .NET Consultant 18 years experienceChris Durkin Resume - Expert .NET Consultant 18 years experience
Chris Durkin Resume - Expert .NET Consultant 18 years experience
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 
vCenter Orchestrator APIs
vCenter Orchestrator APIsvCenter Orchestrator APIs
vCenter Orchestrator APIs
 
SeniorNET Bhanu Resume
SeniorNET Bhanu ResumeSeniorNET Bhanu Resume
SeniorNET Bhanu Resume
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
Satendra Gupta Sr DotNet Consultant
Satendra Gupta Sr  DotNet ConsultantSatendra Gupta Sr  DotNet Consultant
Satendra Gupta Sr DotNet Consultant
 
Walther Aspnet4
Walther Aspnet4Walther Aspnet4
Walther Aspnet4
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

WinRT and the Web: Keeping Windows Store Apps Alive and Connected

  • 1. Consulting/Training WinRT and the Web: Keeping Windows Store Apps Alive and Connected
  • 2. Consulting/Training consulting Wintellect helps you build better software, faster, tackling the tough projects and solving the software and technology questions that help you transform your business.  Architecture, Analysis and Design  Full lifecycle software development  Debugging and Performance tuning  Database design and development training Wintellect's courses are written and taught by some of the biggest and most respected names in the Microsoft programming industry.  Learn from the best. Access the same training Microsoft’s developers enjoy  Real world knowledge and solutions on both current and cutting edge technologies  Flexibility in training options – onsite, virtual, on demand Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins – we pull out all the stops to help our customers achieve their goals through advanced software-based consulting and training solutions. who we are About Wintellect
  • 3. Consulting/Training Building Windows 8 Apps http://bit.ly/win8design “Getting Started Guide” For the more in depth “experts guide” wait for WinRT by Example in early 2014
  • 4. Consulting/Training  WinRT and .NET (and a note about Windows 8.1)  WebView  Simple: HTTP (REST)  OData (WCF Data Services)  Syndication  SOAP  WAMS Agenda
  • 5. Consulting/Training  Most .NET network classes are available to WinRT  Some are being moved into WinRT (i.e. the HttpClient)  Others are proxies and generate pure .NET code as a function of the IDE  We’ll focus on C# but the WinRT components are valid for C++ and JavaScript too WinRT and .NET
  • 6. Consulting/Training  Internet Explorer 10 (11 in 8.1) control  In 8.1 it uses a Direct Composition surface so it can be translated/transformed and overlaid, in 8.0 – er, ouch, wait for 8.1  Capable of rendering SVG and in 8.1 WebGL  Interoperability with the Windows Store app (can call to scripts on the page and vice versa)  Navigation methods (history, journal) built-in WebView Control
  • 7. Consulting/Training this.WebViewControl.Navigate(new Uri(JeremyBlog)); this.WebViewControl.Navigate(new Uri("ms-appx-web:///Data/Ellipse.html")); // can also navigate to streams with a special URI handler in 8.1 this.WebViewControl.NavigateToString(HtmlFragment); var parameters = new[] { "p/biography.html" }; this.WebViewControl.InvokeScript( "superSecretBiographyFunction", parameters); WebView Control
  • 9. Consulting/Training  .NET for 8.0, WinRT for 8.1  Pure control over HTTP  Viable for REST i.e. serialize/deserialize directly from JSON and/or XML  Control headers and manage response as text, stream, etc.  GET, POST, PUT, and DELETE  Using HttpRequestMessage for custom verbs, etc.  Base class for more specialized clients HttpClient
  • 10. Consulting/Training private static readonly MediaTypeWithQualityHeaderValue Json = new MediaTypeWithQualityHeaderValue("application/json"); string jsonResponse; using (var client = new HttpClient()) { client.DefaultRequestHeaders.Accept.Add(Json); jsonResponse = await client.GetStringAsync(productsUri); } var json = JsonObject.Parse(jsonResponse); HttpClient (and a little JSON help)
  • 11. Consulting/Training Parsing a REST service with HttpClient and JSON
  • 12. Consulting/Training  http://msdn.microsoft.com/en- us/jj658961  Add-on for Visual Studio 2012  Allows right-click and add reference for service  Generates the proxy and structures using a data context (similar to Entity Framework / WCF RIA) OData (WCF Services)
  • 14. Consulting/Training ServiceBase = new Uri("http://services.odata.org/OData/OData.svc", UriKind.Absolute); var client = new ODataService.DemoService(ServiceBase); var categoryQuery = client.Categories.AddQueryOption("$expand", "Products"); var categories = await Task<IEnumerable<ODataService.Category>> .Factory.FromAsync( categoryQuery.BeginExecute(result => { }, client), categoryQuery.EndExecute); OData Client Proxy
  • 15. Consulting/Training Connecting to OData using WCF Data Services
  • 16. Consulting/Training  WinRT (mirrors the .NET equivalent very closely)  Parses Atom and RSS  Suitable for both consuming and publishing  Also capable of converting between formats (i.e. read an Atom and serve an RSS) Syndication (Atom/RSS)
  • 17. Consulting/Training private static readonly Uri CSharperImageUri = new Uri( "http://feeds.feedburner.com/CSharperImage/", UriKind.Absolute); var client = new SyndicationClient(); var feed = await client.RetrieveFeedAsync(CSharperImageUri); var group = new DataFeed(feed.Id, feed.Title.Text, AuthorSignature, feed.ImageUri.ToString(), feed.Subtitle.Text); from item in feed.Items let content = Windows.Data.Html.HtmlUtilities.ConvertToText(item.Content.Text) let summary = string.Format("{0} ...", content.Length > 255 ? content.Substring(0, 255) : content) Feed Syndication
  • 19. Consulting/Training  IDE provides similar interface to OData  Uses WSDL to understand the shape of the service  Considered a more complicated protocol but is very widely used and has built-in security, encryption, and other features that are beneficial to the enterprise  Generates a proxy (client) that is used to handle the communications (RPC-based)  Can also use channel factories to create clients SOAP
  • 21. Consulting/Training var proxy = new WeatherSoapClient(); var result = await proxy.GetWeatherInformationAsync(); foreach (var item in result.GetWeatherInformationResult) { this.weather.Add(item); } SOAP Proxy (Generated Client)
  • 22. Consulting/Training using ( var factory = new ChannelFactory<WeatherSoapChannel>( new BasicHttpBinding(), new EndpointAddress("http://wsf.cdyne.com/WeatherWS/Weather.asmx"))) { var channel = factory.CreateChannel(); var forecast = await channel.GetCityForecastByZIPAsync(zipCode); var result = forecast.AsWeatherForecast(); foreach (var day in result.Forecast) { day.ForecastUri = await this.GetImageUriForType(day.TypeId); } return result; } SOAP Proxy (Channel Factory)
  • 24. Consulting/Training  Affectionately referred to as WAMS  Sample project generated by site; in Windows 8.1 it is literally right-click and “add Windows Push Notification Service”  Create simple CRUD and other types of services using hosted SQL  Create push notifications for live updates and notifications within your app Windows Azure Mobile Services
  • 27. Consulting/Training public static MobileServiceClient MobileService = new MobileServiceClient( "https://winrtbyexample.azure-mobile.net/", "ThisIsASecretAndWillLookDifferentForYou" ); private IMobileServiceTable<TodoItem> todoTable = App.MobileService.GetTable<TodoItem>(); var results = await todoTable .Where(todoItem => todoItem.Complete == false) .ToListAsync(); items = new ObservableCollection<TodoItem>(results); ListItems.ItemsSource = items; Windows Azure Mobile Services
  • 29. Consulting/Training  WebView  Simple: HTTP (REST)  OData (WCF Data Services)  Syndication  SOAP  WAMS  Tiles and Notifications  All source code: http://winrtexamples.codeplex.com Recap
  • 30. Consulting/Training Subscribers Enjoy  Expert Instructors  Quality Content  Practical Application  All Devices Wintellect’s On-Demand Video Training Solution Individuals | Businesses | Enterprise Organizations WintellectNOW.com Authors Enjoy  Royalty Income  Personal Branding  Free Library Access  Cross-Sell Opportunities Try It Free! Use Promo Code: LIKNESS-13

Hinweis der Redaktion

  1. Author Opportunity Passive incomeClear marketing commitments to help grow your personal brand and your coursesInternational presence &amp; exposureCross sell opportunities – instructor led classes, consulting opportunities, and conference speaking opportunitiesOpportunity to be the subject matter expert and to carve out a niche for yourself in this new businessAssociation with Wintellect