SlideShare a Scribd company logo
1 of 32
Download to read offline
Building Windows 8 Modern Style
apps for SharePoint 2013
SharePoint Saturday Vietnam 5th
Binh Nguyen
About me
My name is Nguyen Thanh Binh
Work at Bamboo Solutions (http://bamboosolutions.com)
Hobbies: Football; Coffee; SharePoint 
Reach me at:
• Email: binhtnguyen@live.com
• Facebook: http://facebook.com/binhthanhng
• LinkedIn: http://linkedin.com/in/binhthanhng
• Twitter: @binhtnguyen
Agenda
Windows 8 Modern (Metro) Style App
• Introduction Windows 8
• Platform
• DEMO
SharePoint 2013 and Windows 8 App
• APIs
• REST
• Web Services
• DEMO
Q&A
Windows 8 and
Modern Style
apps
Cloud-
connected
Built on a
solid
foundation
Get more at
the Windows
Store
At home and
at work
All the apps
you want
Reimagined
browsing with
IE10
Windows
reimagined
Great
experience
across all
hardware
Windows 8
Windows reimagined
A new Metro style UI where touch is a first-class
citizen along with full mouse-and-keyboard support
New development models built on WinRT, including
native support for HTML/CSS/JS, C#/XAML, C++/DirectX
Designed from the chipset up for multiple form-
factors – tablets, laptops, desktops & all-in-ones
The Windows Store on every device with a full
commerce platform and flexibility
Great experience across all hardware
Built on a solid foundation
Windows 8 Platform
Language projections
DEMO
Windows 8 Apps
SharePoint 2013
and Windows 8
Apps
Connection to SharePoint
Connection
API set in SharePoint 2013
Server Object Model
Client Object Models for managed code
• .NET client object model
• Silverlight client object model
• JavaScript object model
Direct Remote Procedure Calls (RPC) calls to the owssvr.dll
REST/OData endpoints
Web Services (.ASMX)
How to determine which API and language set to use
Type of
Application
Device
which
code runs
Your
existing
skills
SharePoint API and Language for Windows 8 App Dev.
Type of
Application
Device
which
code runs
Your
existing
skills Language
HTML5/CSS and
JavaScript
XAML and C#/VB DirectX and C++/C
SharePoint APIs
Server Object
Model
Client Object
Model
Direct Remote
Procedure
Calls (RPC)
REST/OData
endpoints
Web Services
(.ASMX)
REST
Representational State Transfer (REST) interface in SharePoint 2013
PERFORM basic create, read, update, and delete (CRUD) operations in SharePoint 2013
REST exposes all SharePoint 2013 entities and operations
NO NEED to add references to any SharePoint assemblies/libraries
MAKE a request method to http://siteurl/_api/web/lists
ACCEPT the OData representation of the lists in XML or JSON from the response
Access SharePoint 2013 via REST
• Use Windows 8 Modern App WinJS Library (Microsoft
Window Library for JavaScript SDK) (Recommend)
• Use Cross-platform JavaScript libraries like jQuery,
KnockoutJS, ExtJS…
HTML5/JavaScript
• Use HttpWebRequest or System.Net.HttpClient with
asynchronous calling
• Process the data with Linq-to-XML
XAML/C# - .NET
Reading data
• JavaScript with jQuery
jQuery.ajax({
url: "http://siteurl/_api/web/lists",
type: "GET",
headers: {
"ACCEPT": "application/json;odata=verbose“
},
success: doSuccess,
error: doError
});
• JavaScript with WinJS
WinJS.xhr({
type: "GET",
url: "http://siteurl/_api/web/lists",
headers: { "content-type": "application/json; charset=utf-8" },
}).done(doSuccess, doError);
• C# - VB.NET
HttpWebRequest endpointRequest = (HttpWebRequest)HttpWebRequest.Create(sharepointUrl.ToString() + "/_api/web/lists");
endpointRequest.Method = "GET";
endpointRequest.Accept = "application/json;odata=verbose";
HttpWebResponse endpointResponse = (HttpWebResponse)endpointRequest.GetResponse();
Writing data
• JavaScript with jQuery/WinJS
jQuery.ajax({
url: “http://siteurl/_api/web/lists”,
type: "POST",
data: JSON.stringify({ '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 100,
'ContentTypesEnabled': true, 'Description': 'My list description', 'Title': 'Test' } ),
headers: {
"accept": "application/json;odata=verbose",
"content-type":"application/json;odata=verbose",
"content-length":length of post body
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
success: doSuccess,
error: doError
});
jQuery.ajax({
url: “http://siteurl/_api/web/lists/GetByTitle(‘Test')”,
type: "POST",
data: JSON.stringify({ '__metadata': { 'type': 'SP.List' }, 'Title': 'New title' } ),
headers: {
“X-HTTP-Method”:”MERGE”,
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"content-length":length of post body
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
“IF-MATCH”: “*”
},
success: doSuccess,
error: doError
});
DEMO
REST endpoints
Web Services
(.ASMX)
SharePoint Web Services (.ASMX)
Still supported in SharePoint 2013 framework for backward compatibility
NOT recommend for the new projects
Web Services provide methods to work remotely with a deployment of SharePoint such as:
• Lists Web Services - http://<site>/_vti_bin/Lists.asmx
• Webs Web Services – http://<site>/_vti_bin/Webs.asmx
• Views Web Services - http://<site>/_vti_bin/Views.asmx
• …
• …Simply use the HTTP request to the .asmx include the CAMLQuery to invoke the service
method
For Windows 8 Modern App: we can Web Services apply for both HTML5/JS and XAML/C#
Recommend to use jQuery SPServices (http://spservices.codeplex.com) for HTML5/JS Apps
Code sample
var soapEnv = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> <soap:Body> 
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>
<listName>Announcements</listName><query><Query><Where><Eq><FieldRef Name='Title'/>
<Value Type='Text'>Test Announcement</Value></Eq></Where></Query></query>
<viewFields><ViewFields>
<FieldRef Name='Title' /> <FieldRef Name='Body' /> <FieldRef Name='Expires' />
</ViewFields></viewFields> <rowLimit>99999</rowLimit>
<queryOptions xmlns:SOAPSDK9='http://schemas.microsoft.com/sharepoint/soap/'
><QueryOptions/></queryOptions>
</GetListItems> </soap:Body> </soap:Envelope>";
jQuery.ajax({
url: "http://siteurl/_vti_bin/lists.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
contentType: "text/xml; charset="utf-8"",
complete: function(xData, status){
jQuery(xData.responseXML).find("z:row").each(function () {
$(this).attr("ows_Title");
});
} });
jQuery SPServices
jQuery Library for SharePoint Web Services
Support SharePoint 2007/2010 and 2013 as well
Syntax:
$().SPServices({
operation: "operationname",
[webURL: "/sitepath",]
[option1: value1,]
[option2: value2,]
[async: false,]
completefunc: function (xData, Status) {
...do stuff...
}
});
jQuery SPServices sample
$().SPServices({
webURL: "http://siteurl/"
operation: "GetListItems",
async: false,
listName: "Announcements",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
$("#tasksUL").append(liHtml);
});
}
});
SPServices({
operation: "UpdateListItems",
listName: testList,
ID: ID,
valuepairs: [["Title", “abc”]],
completefunc: function (xData, Status) {
…
}
});
DEMO
Web Services (.ASMX)
Versus 
HTML5/JavaScript
JavaScript and HTML is more comfortable for SharePoint
Developers than the XAML and Silverlight
Since Windows 8 App uses the Internet Explorer 10 engine for
HTML5/CSS, then easy to port the current SharePoint
App/ASPX/HTML to Windows 8 App.
Create a cross-platform application that can easily become a
mobile app or even a SharePoint app (Re-use)
HTML5/CSS is easy to use, branding, design and get support from
other team, community, Internet…
HTML5 is the future so it's best to always be up to date.
XAML/C#
Object Oriented Programming: Unit Testing, inheritance,
polymorphism, architectural reuse…
Reuse the .NET Libraries for your Windows 8 App
Easy to port the current XAML app to Windows 8 App such as: Xbox,
Windows Phone, Windows Embedded, Windows Desktop,
Silverlight…
Strong in Animations, Transitions and Effects
XAML is Resolution Independence and vector-based, can leverage
GPU acceleration and scale indefinitely
“Liệu cơm gắp mắm, Tùy app chọn code”
Reference
 http://msdn.microsoft.com/en-us/windows/apps/br229512.aspx
 http://msdn.microsoft.com/en-us/library/jj164022(v=office.15).aspx
 http://msdn.microsoft.com/en-us/library/jj164060(v=office.15).aspx
 http://blogs.microsoft.co.il/blogs/choroshin/archive/2012/09/15/how-to-create-a-windows-8-app-for-
sharepoint-part-1-the-planning-stage.aspx
 http://blogs.microsoft.co.il/blogs/choroshin/archive/2012/09/30/how-to-create-a-windows-8-app-for-
sharepoint-part-2-the-development-stage.aspx
 http://spservices.codeplex.com/
Q&A
Thank you!
See you at next SharePoint Saturday Vietnam event!

More Related Content

What's hot (8)

phpWebApp presentation
phpWebApp presentationphpWebApp presentation
phpWebApp presentation
 
Chapter 1 (asp.net over view)
Chapter 1 (asp.net over view)Chapter 1 (asp.net over view)
Chapter 1 (asp.net over view)
 
Getting Information through HTML Forms
Getting Information through HTML FormsGetting Information through HTML Forms
Getting Information through HTML Forms
 
Selenium for-ops
Selenium for-opsSelenium for-ops
Selenium for-ops
 
Learn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGLearn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUG
 
Introducing the JotSpot Data Model and API
Introducing the JotSpot Data Model and APIIntroducing the JotSpot Data Model and API
Introducing the JotSpot Data Model and API
 
lect4
lect4lect4
lect4
 
Introductionto asp net-ppt
Introductionto asp net-pptIntroductionto asp net-ppt
Introductionto asp net-ppt
 

Viewers also liked (6)

Insights from Google for Vietnam mar2016
Insights from Google for Vietnam mar2016Insights from Google for Vietnam mar2016
Insights from Google for Vietnam mar2016
 
VN Education insights
VN Education insightsVN Education insights
VN Education insights
 
VN Digital consumer behaviour Retail
VN Digital consumer behaviour RetailVN Digital consumer behaviour Retail
VN Digital consumer behaviour Retail
 
VN Travel Insights
VN Travel InsightsVN Travel Insights
VN Travel Insights
 
VN Real Estate insights
VN Real Estate insightsVN Real Estate insights
VN Real Estate insights
 
comparing quantities class 8
comparing quantities class 8comparing quantities class 8
comparing quantities class 8
 

Similar to Building windows8 modern app for sp2013

Java Technology
Java TechnologyJava Technology
Java Technology
ifnu bima
 
django_introduction20141030
django_introduction20141030django_introduction20141030
django_introduction20141030
Kevin Wu
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
Kiril Iliev
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development Overview
Rob Windsor
 
03 form-data
03 form-data03 form-data
03 form-data
snopteck
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
lanslote
 

Similar to Building windows8 modern app for sp2013 (20)

CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
 
SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIs
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta
 
Java Technology
Java TechnologyJava Technology
Java Technology
 
08 ajax
08 ajax08 ajax
08 ajax
 
django_introduction20141030
django_introduction20141030django_introduction20141030
django_introduction20141030
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development Overview
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the web
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365
 
Building appsinsilverlight4 part_1
Building appsinsilverlight4 part_1Building appsinsilverlight4 part_1
Building appsinsilverlight4 part_1
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
 
03 form-data
03 form-data03 form-data
03 form-data
 
uMobile Preconference Seminar
uMobile Preconference SeminaruMobile Preconference Seminar
uMobile Preconference Seminar
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
 
Use Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsUse Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile Apps
 

More from Vinh Nguyen

More from Vinh Nguyen (20)

[Think Next] Gói giải pháp bản địa hóa QAD ERP cho thị trường Việt Nam (VIE)
[Think Next] Gói giải pháp bản địa hóa QAD ERP cho thị trường Việt Nam (VIE)[Think Next] Gói giải pháp bản địa hóa QAD ERP cho thị trường Việt Nam (VIE)
[Think Next] Gói giải pháp bản địa hóa QAD ERP cho thị trường Việt Nam (VIE)
 
[Think Next] VAS and Localization Solution QAD ERP for Vietnam Region (EN)
[Think Next] VAS and Localization Solution QAD ERP for Vietnam Region (EN)[Think Next] VAS and Localization Solution QAD ERP for Vietnam Region (EN)
[Think Next] VAS and Localization Solution QAD ERP for Vietnam Region (EN)
 
Quản Lý Nghiệp - Geshe Michael Roach
Quản Lý Nghiệp - Geshe Michael RoachQuản Lý Nghiệp - Geshe Michael Roach
Quản Lý Nghiệp - Geshe Michael Roach
 
Nâng Đoạn Kim Cương - Geshe Michael Roach
Nâng Đoạn Kim Cương - Geshe Michael RoachNâng Đoạn Kim Cương - Geshe Michael Roach
Nâng Đoạn Kim Cương - Geshe Michael Roach
 
[Think Next] Cẩm nang làm việc từ xa work from home (WFH)
[Think Next] Cẩm nang làm việc từ xa work from home (WFH)[Think Next] Cẩm nang làm việc từ xa work from home (WFH)
[Think Next] Cẩm nang làm việc từ xa work from home (WFH)
 
Social media for Lead generation
Social media for Lead generationSocial media for Lead generation
Social media for Lead generation
 
Nielsen Q1-2016 global consumer confidence report digital final
Nielsen Q1-2016 global consumer confidence report digital finalNielsen Q1-2016 global consumer confidence report digital final
Nielsen Q1-2016 global consumer confidence report digital final
 
VN Digital Consumer behaviour Retail
VN Digital Consumer behaviour RetailVN Digital Consumer behaviour Retail
VN Digital Consumer behaviour Retail
 
Economy SEA 2016
Economy SEA 2016Economy SEA 2016
Economy SEA 2016
 
Microsoft Dynamics CRM 2015 Release Preview Guide
Microsoft Dynamics CRM 2015 Release Preview GuideMicrosoft Dynamics CRM 2015 Release Preview Guide
Microsoft Dynamics CRM 2015 Release Preview Guide
 
47 creative photography & photoshop projects
47 creative photography & photoshop projects47 creative photography & photoshop projects
47 creative photography & photoshop projects
 
The portraits & landscapes photography book
The portraits & landscapes photography bookThe portraits & landscapes photography book
The portraits & landscapes photography book
 
500 poses for photographing men
500 poses for photographing men500 poses for photographing men
500 poses for photographing men
 
500 poses for photographing group portraits
500 poses for photographing group portraits500 poses for photographing group portraits
500 poses for photographing group portraits
 
47 creative photography & photoshop projects
47 creative photography & photoshop projects47 creative photography & photoshop projects
47 creative photography & photoshop projects
 
Google ad words căn bản
Google ad words căn bảnGoogle ad words căn bản
Google ad words căn bản
 
Google Adwords Advance - Google Adwords Nâng Cao
Google Adwords Advance - Google Adwords Nâng CaoGoogle Adwords Advance - Google Adwords Nâng Cao
Google Adwords Advance - Google Adwords Nâng Cao
 
Sage - HOW TO CHOOSE A CRM
Sage - HOW TO CHOOSE A CRMSage - HOW TO CHOOSE A CRM
Sage - HOW TO CHOOSE A CRM
 
Sage CRM product brochure
Sage CRM product brochureSage CRM product brochure
Sage CRM product brochure
 
QAD OnDemand Cloud ERP Benefits Infographic
QAD OnDemand Cloud ERP Benefits InfographicQAD OnDemand Cloud ERP Benefits Infographic
QAD OnDemand Cloud ERP Benefits Infographic
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+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@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
+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...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Building windows8 modern app for sp2013

  • 1. Building Windows 8 Modern Style apps for SharePoint 2013 SharePoint Saturday Vietnam 5th Binh Nguyen
  • 2. About me My name is Nguyen Thanh Binh Work at Bamboo Solutions (http://bamboosolutions.com) Hobbies: Football; Coffee; SharePoint  Reach me at: • Email: binhtnguyen@live.com • Facebook: http://facebook.com/binhthanhng • LinkedIn: http://linkedin.com/in/binhthanhng • Twitter: @binhtnguyen
  • 3. Agenda Windows 8 Modern (Metro) Style App • Introduction Windows 8 • Platform • DEMO SharePoint 2013 and Windows 8 App • APIs • REST • Web Services • DEMO Q&A
  • 4. Windows 8 and Modern Style apps
  • 5. Cloud- connected Built on a solid foundation Get more at the Windows Store At home and at work All the apps you want Reimagined browsing with IE10 Windows reimagined Great experience across all hardware Windows 8
  • 6. Windows reimagined A new Metro style UI where touch is a first-class citizen along with full mouse-and-keyboard support New development models built on WinRT, including native support for HTML/CSS/JS, C#/XAML, C++/DirectX Designed from the chipset up for multiple form- factors – tablets, laptops, desktops & all-in-ones The Windows Store on every device with a full commerce platform and flexibility
  • 7. Great experience across all hardware
  • 8. Built on a solid foundation
  • 14. API set in SharePoint 2013 Server Object Model Client Object Models for managed code • .NET client object model • Silverlight client object model • JavaScript object model Direct Remote Procedure Calls (RPC) calls to the owssvr.dll REST/OData endpoints Web Services (.ASMX)
  • 15. How to determine which API and language set to use Type of Application Device which code runs Your existing skills
  • 16. SharePoint API and Language for Windows 8 App Dev. Type of Application Device which code runs Your existing skills Language HTML5/CSS and JavaScript XAML and C#/VB DirectX and C++/C SharePoint APIs Server Object Model Client Object Model Direct Remote Procedure Calls (RPC) REST/OData endpoints Web Services (.ASMX)
  • 17. REST
  • 18. Representational State Transfer (REST) interface in SharePoint 2013 PERFORM basic create, read, update, and delete (CRUD) operations in SharePoint 2013 REST exposes all SharePoint 2013 entities and operations NO NEED to add references to any SharePoint assemblies/libraries MAKE a request method to http://siteurl/_api/web/lists ACCEPT the OData representation of the lists in XML or JSON from the response
  • 19. Access SharePoint 2013 via REST • Use Windows 8 Modern App WinJS Library (Microsoft Window Library for JavaScript SDK) (Recommend) • Use Cross-platform JavaScript libraries like jQuery, KnockoutJS, ExtJS… HTML5/JavaScript • Use HttpWebRequest or System.Net.HttpClient with asynchronous calling • Process the data with Linq-to-XML XAML/C# - .NET
  • 20. Reading data • JavaScript with jQuery jQuery.ajax({ url: "http://siteurl/_api/web/lists", type: "GET", headers: { "ACCEPT": "application/json;odata=verbose“ }, success: doSuccess, error: doError }); • JavaScript with WinJS WinJS.xhr({ type: "GET", url: "http://siteurl/_api/web/lists", headers: { "content-type": "application/json; charset=utf-8" }, }).done(doSuccess, doError); • C# - VB.NET HttpWebRequest endpointRequest = (HttpWebRequest)HttpWebRequest.Create(sharepointUrl.ToString() + "/_api/web/lists"); endpointRequest.Method = "GET"; endpointRequest.Accept = "application/json;odata=verbose"; HttpWebResponse endpointResponse = (HttpWebResponse)endpointRequest.GetResponse();
  • 21. Writing data • JavaScript with jQuery/WinJS jQuery.ajax({ url: “http://siteurl/_api/web/lists”, type: "POST", data: JSON.stringify({ '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 100, 'ContentTypesEnabled': true, 'Description': 'My list description', 'Title': 'Test' } ), headers: { "accept": "application/json;odata=verbose", "content-type":"application/json;odata=verbose", "content-length":length of post body "X-RequestDigest": $("#__REQUESTDIGEST").val() }, success: doSuccess, error: doError }); jQuery.ajax({ url: “http://siteurl/_api/web/lists/GetByTitle(‘Test')”, type: "POST", data: JSON.stringify({ '__metadata': { 'type': 'SP.List' }, 'Title': 'New title' } ), headers: { “X-HTTP-Method”:”MERGE”, "accept": "application/json;odata=verbose", "content-type": "application/json;odata=verbose", "content-length":length of post body "X-RequestDigest": $("#__REQUESTDIGEST").val(), “IF-MATCH”: “*” }, success: doSuccess, error: doError });
  • 24. SharePoint Web Services (.ASMX) Still supported in SharePoint 2013 framework for backward compatibility NOT recommend for the new projects Web Services provide methods to work remotely with a deployment of SharePoint such as: • Lists Web Services - http://<site>/_vti_bin/Lists.asmx • Webs Web Services – http://<site>/_vti_bin/Webs.asmx • Views Web Services - http://<site>/_vti_bin/Views.asmx • … • …Simply use the HTTP request to the .asmx include the CAMLQuery to invoke the service method For Windows 8 Modern App: we can Web Services apply for both HTML5/JS and XAML/C# Recommend to use jQuery SPServices (http://spservices.codeplex.com) for HTML5/JS Apps
  • 25. Code sample var soapEnv = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> <soap:Body> <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> <listName>Announcements</listName><query><Query><Where><Eq><FieldRef Name='Title'/> <Value Type='Text'>Test Announcement</Value></Eq></Where></Query></query> <viewFields><ViewFields> <FieldRef Name='Title' /> <FieldRef Name='Body' /> <FieldRef Name='Expires' /> </ViewFields></viewFields> <rowLimit>99999</rowLimit> <queryOptions xmlns:SOAPSDK9='http://schemas.microsoft.com/sharepoint/soap/' ><QueryOptions/></queryOptions> </GetListItems> </soap:Body> </soap:Envelope>"; jQuery.ajax({ url: "http://siteurl/_vti_bin/lists.asmx", type: "POST", dataType: "xml", data: soapEnv, contentType: "text/xml; charset="utf-8"", complete: function(xData, status){ jQuery(xData.responseXML).find("z:row").each(function () { $(this).attr("ows_Title"); }); } });
  • 26. jQuery SPServices jQuery Library for SharePoint Web Services Support SharePoint 2007/2010 and 2013 as well Syntax: $().SPServices({ operation: "operationname", [webURL: "/sitepath",] [option1: value1,] [option2: value2,] [async: false,] completefunc: function (xData, Status) { ...do stuff... } });
  • 27. jQuery SPServices sample $().SPServices({ webURL: "http://siteurl/" operation: "GetListItems", async: false, listName: "Announcements", CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>", completefunc: function (xData, Status) { $(xData.responseXML).SPFilterNode("z:row").each(function() { var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>"; $("#tasksUL").append(liHtml); }); } }); SPServices({ operation: "UpdateListItems", listName: testList, ID: ID, valuepairs: [["Title", “abc”]], completefunc: function (xData, Status) { … } });
  • 29. Versus  HTML5/JavaScript JavaScript and HTML is more comfortable for SharePoint Developers than the XAML and Silverlight Since Windows 8 App uses the Internet Explorer 10 engine for HTML5/CSS, then easy to port the current SharePoint App/ASPX/HTML to Windows 8 App. Create a cross-platform application that can easily become a mobile app or even a SharePoint app (Re-use) HTML5/CSS is easy to use, branding, design and get support from other team, community, Internet… HTML5 is the future so it's best to always be up to date. XAML/C# Object Oriented Programming: Unit Testing, inheritance, polymorphism, architectural reuse… Reuse the .NET Libraries for your Windows 8 App Easy to port the current XAML app to Windows 8 App such as: Xbox, Windows Phone, Windows Embedded, Windows Desktop, Silverlight… Strong in Animations, Transitions and Effects XAML is Resolution Independence and vector-based, can leverage GPU acceleration and scale indefinitely “Liệu cơm gắp mắm, Tùy app chọn code”
  • 30. Reference  http://msdn.microsoft.com/en-us/windows/apps/br229512.aspx  http://msdn.microsoft.com/en-us/library/jj164022(v=office.15).aspx  http://msdn.microsoft.com/en-us/library/jj164060(v=office.15).aspx  http://blogs.microsoft.co.il/blogs/choroshin/archive/2012/09/15/how-to-create-a-windows-8-app-for- sharepoint-part-1-the-planning-stage.aspx  http://blogs.microsoft.co.il/blogs/choroshin/archive/2012/09/30/how-to-create-a-windows-8-app-for- sharepoint-part-2-the-development-stage.aspx  http://spservices.codeplex.com/
  • 31. Q&A
  • 32. Thank you! See you at next SharePoint Saturday Vietnam event!