Building Modern Style Windows 8 Apps for SharePoint 2013
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
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
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)
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
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
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”