SlideShare a Scribd company logo
1 of 54
Windows store apps:
WinJS vs PhoneGap
Damyan Petev
Technical Evangelist, Infragistics
dpetev@infragistics.com
@DamyanPetev

Mihail Mateev
Senior Technical Evangelist, Infragistics
mmateev@infragistics.com
@MihailMateev
Agenda
•
•
•
•
•
•

Windows Store Apps Intro
WinJS and all that madness
Similarities and differences
PhoneGap
Resources
Q&A
Microsoft
Microsoft
Principals
•
•
•
•
•

Pride in craftsmanship
Fast and fluid
Authentically digital
Do more with less
Win as one
WinJS
• Controls and
other UI building
blocks for
Modern UI style
apps
• Style sheets with
default Modern
UI style design
• Common
infrastructure for
responsive,

HTML / CSS
• Powerful engine
for creating user
interfaces
• Reuse skills &
code from the
standard web
• New HTML / CSS
features give you
the capabilities to
make great UI/UX

WinRT
• Seamlessly
integrate with the
Modern UI style
shell
• Connect to other
apps through
contracts
• Access storage,
devices, and
other capabilities
of the PC
WinJS
Toolkits
IE is ok these days!
•

Like, it actually is!
Why WinJS Apps
If You are a web developer today …
Build Native Apps With Your Existing Skill Set and
Experience (mostly )
–
–
–
–

Familiar programming model
Full benefit of hardware acceleration
WinRT API & feature access
Popular JavaScript libraries work in WinJS apps - jQuery,
Ignite UI, Knockout, Angular, game engines, etc
WinJS.xhr

HTML/DOM Utils

WinJS Element
Attributes

Logging Utils
WinJS

WinJS.Promise

Element
Selection/
Querying

Keyboard Key
Enumeration

Validation
WinJS

WinJS.PromiseStat
eMachine

Coordinate
Conversion

Support for WinJS
declarative model
(supportedForProc
essing)

Class definition
and inheritance
WinJS.Class

Namespace
definition utilities
WinJS.Namespace

WinJS.ErrorFro
mName

Localized String
Utilities

Data-win-res
processing

Semantic Zoom

ViewBox
ListView

Flyout

SettingsFlyout

Menu

Menu
Command

GridLayout

ListLayout

WinJS Toolkits
Support for
declarative model
(processAll)

Controls
Utilities (
setOptions)

IZoomableView

Custom Layout
Interface

AppBar

IListBinding

Fragment loading
and rendering
WinJS.UI.Fragments

IListDataSource

IListDataAdapte
r

IListN
H

DataSourceStatus

StorageDataSo
urce

VirtualizedData
Source

Erro

FlipView

WinJS.UI.
Animation
helpers

Animation
Library

Data Binding
(as, bind)

Mixins

WinJS.Binding.
List

Conversions

List Projections

Support for
declarative
databinding

Animation System
Management

Application
Events

WinJS.
Application.
sessionState
WinJS.Navigation
Functions

local
(storage)

roaming
(storage)

temp
(storage)

WinJS.UI.Pages.
PageControl

WinJS.Binding.
Template

WinJS.UI.Pages.
IPageControlM
embers

Tooltip

Rating

TabContainer

TimePicker

DatePicker

ToggleSwitch

HTMLControl

Light StyleSheet

Dark StyleSheet
Personality

What Makes a Windows Store App a
Windows Store App?
•
•
•
•
•
•
•
•
•

Fast & Fluid
Live Tiles
Animations
Transitions
Charms
AppBar
Search
Contracts
Device Access
Controls

Native Windows Controls
Extra UI at no cost

App Bar

Settings
Windows UI Apps feature
adaptive layouts :

Layouts

•
•
•

Multiple screen size support
Snapped and filled view
states
Handle rotation

CSS Layouts :
• CSS Grid, CSS Flexbox, CSS
Multicolumn, Media Queries
• Fast & Fluid Native
performance

X
Full View

Snapped
View

X
Fill View
Transforms &
Animations

CSS & WinJS Animation Library
Page transition
Content transition
Fade in/out
Crossfade
Pointer up/down
Expand/Collapse
Reposition
Show/Hide popup
Show/Hide edge UI

Show/Hide panel
Add/Delete from list
Add/Delete from search list
Peek
Badge update
Start/End a drag or drag-between
Swipe hint
Swipe select/deselect
Touch, Pan, Zoom,
Scroll

Fast & Fluid Interaction via CSS
Windows Store Apps feature direct manipulation panning and zooming of content
as a predominant user interface paradigm.
CSS gives you:
• Support touch, mouse, and keyboard
• “Stick to the finger” experience for panning and zooming
• Consistent user experience with rails, inertia, and boundary feedback
• Support for snap points, nesting, and chaining
WinJS Stylesheets

Styling an App
•

Beautiful Dark & Light styles are built in

•

Well defined, meaningful selectors you can easily understand and override

•

Visual Studio templates help a lot
default.css
• Transparent to developers
• Provides styles for:
– Base elements (HTML, Body, Iframe…)
– Text elements (H1, P, DD…)
– HTML controls (checkbox, radio
button, range…)
– WinJS controls (ratings, toggle…)
– Additional text element style classes
(title, subtitle, item text…)
– Additional HTML control style classes
(back button…)
Built-in styling classes
<!– Get a custom back button look -->
<button class="win-backbutton"></button>

<h1 class="win-title">win-title</h1>
<h1 class="win-contentTitle">wincontentTitle</h1>
<h1 class="win-contentSubtitle">wincontentSubtitle</h1>
ALM
Is it really the same?
Of standards and popular terms
Modern patterns and practices you might know/have seen

• Strict mode
• Promises [ async ]
• SPA
I’ll get back to you.. I promise!*
from the callback with love

var promise = doSomeWork();
promise.then(function(foo){
// continue working here
return doSomeMoreWork();
}).then(function(result){
// …
});
*but can’t promise to solve all your problems.
SPA
Single Page App
• Web is stateless in nature
• Navigation means loosing context
• Apps shouldn’t be like that, so:
SPA
•

Keeping it familiar…

<!-- A hyperlink to page2.html. --> <p><a href="/pages/page2/page2.html">Go to page 2.</a></p>
Simple…

WinJS.Utilities.query("a").listen("click",
this.linkClickEventHandler, false);
Pages & Navigation

Application Shell
Page Content

• Navigation template
• AppBar integration
• Load and [unload] chunks of HTML + CSS
+ JS
• Page content can be dynamic including
other WinJS controls within it
• Context & State are maintained

A series of events to control the process:

Before
Navigate
before navigation
attempt

Navigating
navigating away from
a page

Navigated
The platform differences
• No alert 
• ms-appx:/// vs. http(s):// vs. file:/// vs. ms-appdata:///

X

X

• DOM Security - With great power come.. great restrictions :)

Still OK :
• window.close() //quite useless though
• createElement
Not in the face !!111!1!!
•

If ( using DOM) filter through toStaticHTML()
–
–
–
–
–
–

•
•

createContextualFragment
innerHTML / outerHTML
insertAdjacentHTML
pasteHTML
document.write / document.writeln
DOMParser.parseFromString

WinJS.Utilities.markSupportedForProcessing(functionName);
Alternative?

var someElement = document.getElementById('someElementID');
MSApp.execUnsafeLocalFunction( function() {
someElement.innerHTML = '<div onclick="console.log("hi");">hi</div>'
});
Controls + Data Binding
•

Rating:

<div id="Div1" data-win-control="WinJS.UI.Rating"
data-win-bind="winControl.averageRating: rating"
data-win-options="{maxRating:5}"></div>
• AppBar:
<div id="appbar" data-win-control="WinJS.UI.AppBar">
<button data-win-control="WinJS.UI.AppBarCommand“..

• Navigation container:
<div id="contenthost"
data-win-control="Application.PageControlNavigator"
data-win-options="{home: '/pages/home/home.html'}">
</div>
Demo Time!
Debug
• DOM Explorer and JavaScript Console
• Remote Debug
• Simulation of states
• VS 2013 – Performance and Diagnostics
PhoneGap
Why PhoneGap?
• There are more
than 100 000 000
WEB developers!
• The web is
awesome!
What is PhoneGap ?

Your Code
What is PhoneGap ?

Your Code

Native Web View
What is PhoneGap ?

Your Code
Native Web View
Native APIs
What is PhoneGap ?

Your Code
Native Web View

Native APIs
Native App - .apk, .xap, etc.
What is PhoneGap ?
• PhoneGap / Cordova for Windows Store App
uses WinJS
• There is no “special” cordova Web View for
WinRT
PhoneGap / Cordova API
•
•
•
•
•
•

Accelerometer
Camera
Capture (video)
Compass
Connection
Contacts

•
•
•
•
•
•
•

Device
File IO
Geolocation
Globalization
Media
Notifications
Storage (database)
PhoneGap / Cordova Platforms
PhoneGap / Cordova Platforms
PhoneGap / Cordova CLI
Requires Node.js

$ npm install -g cordova
$ cordova create hello com.example.hello
HelloWorld
$ cordova platform add windows8
$ cordova run windows8
$ cordova emulate windows8
$ cordova platform update windows8
Debugging PhoneGap for
Windows Store Apps:
• 2 ways to debug PhoneCap/Windows 8.x App
– As WinJS App
– As PhoneGap App (winery, http://debug.phonegap.com/)
Naturally, apps targeted at 8.1
don’t get scaled down for Win 8.
So yeah, there’s that.
The take away
•

WinJS vs PhoneGap is a matter of API preference and code portability

•

Windows Store basic rules apply to PhoneGap

•

Do whatever you feel like, as long as you:
– Stay within platform look and feel
– Understand the sandbox model of the app

•

Mash up frameworks and tools:
– Should be compatible (like jQuery 2.x)
– Or use workarounds
•

Състезание 1: Windows
8.1 или Windows Phone 8
http://bgapps.promorc.com/
• Състезание 2: Win 8 app
– Best UX
– Most Innovative
– Best migrated from WP
– More worldwide
http://winappdevcon.promorc.com
Resources
•

The ‘everything you need and more’ place:
– http://msdn.microsoft.com/en-US/windows/apps/
• Windows 8 samples:
– http://code.msdn.microsoft.com/windowsapps/Windows-8-app-samples-4d76cbbf
• Windows 8.1 Samples:
– http://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-AppSamples
• Free ebook: Programming Windows Store Apps with HTML, CSS, and JavaScript, Second
Edition (second preview):
• http://aka.ms/secondedition/secondpreview
http://blogs.msdn.com/b/microsoft_press/archive/2013/10/29/free-ebook-programmingwindows-store-apps-with-html-css-and-javascript-second-edition-second-preview.aspx
Resources & Q&A
•
•

•

WinJS for the PhoneGap developer blog series:
– http://blogs.msdn.com/b/glengordon/
Windows 8 Platform Guide
– http://docs.phonegap.com/en/edge/guide_platforms_win8_index.md.html
Next event: Building your first Analysis Services solution (11 of February, 2014)
– Speaker: Ivan Donev
Resources & Q&A
•

Next conference: Azure Bootcamp Bulgaria (29 of Mach, 2014)
THANK YOU!

More Related Content

What's hot

Building Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIRBuilding Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIR
funkatron
 
Architecting For Ux
Architecting For UxArchitecting For Ux
Architecting For Ux
Josh Holmes
 
RIM Casual Meetup - Bandung #DevIDBdg
RIM Casual Meetup - Bandung #DevIDBdgRIM Casual Meetup - Bandung #DevIDBdg
RIM Casual Meetup - Bandung #DevIDBdg
Ziyad Bazed
 

What's hot (20)

a11yTO - Web Accessibility for Developers
a11yTO - Web Accessibility for Developersa11yTO - Web Accessibility for Developers
a11yTO - Web Accessibility for Developers
 
Mobile web development
Mobile web development Mobile web development
Mobile web development
 
State of jQuery '09
State of jQuery '09State of jQuery '09
State of jQuery '09
 
Sharepoint mobile
Sharepoint mobileSharepoint mobile
Sharepoint mobile
 
Mobile Web & HTML5 Performance Optimization
Mobile Web & HTML5 Performance OptimizationMobile Web & HTML5 Performance Optimization
Mobile Web & HTML5 Performance Optimization
 
Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!
 
Building Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIRBuilding Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIR
 
Web Accessibility - A feature you can build
Web Accessibility - A feature you can buildWeb Accessibility - A feature you can build
Web Accessibility - A feature you can build
 
Accessibility - A feature you can build
Accessibility - A feature you can buildAccessibility - A feature you can build
Accessibility - A feature you can build
 
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile FrameworkBuilding a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
 
Tips for Building your First XPages Java Application
Tips for Building your First XPages Java ApplicationTips for Building your First XPages Java Application
Tips for Building your First XPages Java Application
 
The Status Of Web Interoperability And Activities In China, Japan And Korea
The Status Of Web Interoperability And Activities In China, Japan And KoreaThe Status Of Web Interoperability And Activities In China, Japan And Korea
The Status Of Web Interoperability And Activities In China, Japan And Korea
 
There Are No “Buts” in Progressive Enhancement [Øredev 2015]
There Are No “Buts” in Progressive Enhancement [Øredev 2015]There Are No “Buts” in Progressive Enhancement [Øredev 2015]
There Are No “Buts” in Progressive Enhancement [Øredev 2015]
 
Architecting For Ux
Architecting For UxArchitecting For Ux
Architecting For Ux
 
Engage - Expanding XPages with Bootstrap Plugins for ultimate usability
Engage - Expanding XPages with Bootstrap Plugins for ultimate usabilityEngage - Expanding XPages with Bootstrap Plugins for ultimate usability
Engage - Expanding XPages with Bootstrap Plugins for ultimate usability
 
Html5 features: location, history and offline apps
Html5 features: location, history and offline appsHtml5 features: location, history and offline apps
Html5 features: location, history and offline apps
 
Modern JavaScript Frameworks: Angular, React & Vue.js
Modern JavaScript Frameworks: Angular, React & Vue.jsModern JavaScript Frameworks: Angular, React & Vue.js
Modern JavaScript Frameworks: Angular, React & Vue.js
 
RIM Casual Meetup - Bandung #DevIDBdg
RIM Casual Meetup - Bandung #DevIDBdgRIM Casual Meetup - Bandung #DevIDBdg
RIM Casual Meetup - Bandung #DevIDBdg
 
jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPages
 

Viewers also liked

MY RESUME SECOND PAGE
MY RESUME SECOND PAGEMY RESUME SECOND PAGE
MY RESUME SECOND PAGE
Jerome White
 
Asi jugamos y aprendemos nuestros nombres
Asi jugamos y aprendemos nuestros nombresAsi jugamos y aprendemos nuestros nombres
Asi jugamos y aprendemos nuestros nombres
CEIP TIERRA DE PINARES
 
Age related atrophy & sarcopenia Original Hypothesis Abstract - 2015
Age related atrophy  & sarcopenia Original Hypothesis Abstract - 2015Age related atrophy  & sarcopenia Original Hypothesis Abstract - 2015
Age related atrophy & sarcopenia Original Hypothesis Abstract - 2015
Kenneth Craig
 

Viewers also liked (19)

Resume Roadmap
Resume RoadmapResume Roadmap
Resume Roadmap
 
Le roller derby
Le roller derbyLe roller derby
Le roller derby
 
MY RESUME SECOND PAGE
MY RESUME SECOND PAGEMY RESUME SECOND PAGE
MY RESUME SECOND PAGE
 
Otoño 5 años
Otoño 5 añosOtoño 5 años
Otoño 5 años
 
หา3ภพจนเจอ2016 กูตั้งใจทำดีสุดยอดการ์ตูน48ข้อ2015
หา3ภพจนเจอ2016 กูตั้งใจทำดีสุดยอดการ์ตูน48ข้อ2015หา3ภพจนเจอ2016 กูตั้งใจทำดีสุดยอดการ์ตูน48ข้อ2015
หา3ภพจนเจอ2016 กูตั้งใจทำดีสุดยอดการ์ตูน48ข้อ2015
 
Question 1
Question 1Question 1
Question 1
 
Asi jugamos y aprendemos nuestros nombres
Asi jugamos y aprendemos nuestros nombresAsi jugamos y aprendemos nuestros nombres
Asi jugamos y aprendemos nuestros nombres
 
before_after small buisness
before_after small buisnessbefore_after small buisness
before_after small buisness
 
Baño Marroqui López Saida
Baño Marroqui López SaidaBaño Marroqui López Saida
Baño Marroqui López Saida
 
Vdn justine
Vdn justineVdn justine
Vdn justine
 
LOS NIÑOS DE 5 AÑOS A OS DESEAMOS FELIZ NAVIDAD
LOS NIÑOS DE 5 AÑOS A OS DESEAMOS FELIZ NAVIDADLOS NIÑOS DE 5 AÑOS A OS DESEAMOS FELIZ NAVIDAD
LOS NIÑOS DE 5 AÑOS A OS DESEAMOS FELIZ NAVIDAD
 
Age related atrophy & sarcopenia Original Hypothesis Abstract - 2015
Age related atrophy  & sarcopenia Original Hypothesis Abstract - 2015Age related atrophy  & sarcopenia Original Hypothesis Abstract - 2015
Age related atrophy & sarcopenia Original Hypothesis Abstract - 2015
 
HART letter
HART letterHART letter
HART letter
 
Tips membuat presentasi memukau dan ramah otak ver wes
Tips membuat presentasi memukau dan  ramah otak   ver wesTips membuat presentasi memukau dan  ramah otak   ver wes
Tips membuat presentasi memukau dan ramah otak ver wes
 
persentasi interaktif
persentasi interaktifpersentasi interaktif
persentasi interaktif
 
Build a custom metrics on aws cloud
Build a custom metrics on aws cloudBuild a custom metrics on aws cloud
Build a custom metrics on aws cloud
 
Patterns of Rejection - conclusion
Patterns of Rejection - conclusionPatterns of Rejection - conclusion
Patterns of Rejection - conclusion
 
Patterns of racial and ethnic relations
Patterns of racial and ethnic relationsPatterns of racial and ethnic relations
Patterns of racial and ethnic relations
 
Varna conf nodejs-oss-microsoft-azure[final]
Varna conf nodejs-oss-microsoft-azure[final]Varna conf nodejs-oss-microsoft-azure[final]
Varna conf nodejs-oss-microsoft-azure[final]
 

Similar to Win j svsphonegap-damyan-petev-mihail-mateev

Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
Chris Morrell
 
State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conference
dmethvin
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
Jia Mi
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
Nuxeo
 

Similar to Win j svsphonegap-damyan-petev-mihail-mateev (20)

Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app
 
Busy Developer's Guide to Windows 8 HTML/JavaScript Apps
Busy Developer's Guide to Windows 8 HTML/JavaScript AppsBusy Developer's Guide to Windows 8 HTML/JavaScript Apps
Busy Developer's Guide to Windows 8 HTML/JavaScript Apps
 
State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conference
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
 
Intro to Xamarin
Intro to XamarinIntro to Xamarin
Intro to Xamarin
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
 
Android - Anroid Pproject
Android - Anroid PprojectAndroid - Anroid Pproject
Android - Anroid Pproject
 
Mobile web or native app
Mobile web or native appMobile web or native app
Mobile web or native app
 
"WebView, the fifth element" por @fernando_cejas
"WebView, the fifth element" por @fernando_cejas"WebView, the fifth element" por @fernando_cejas
"WebView, the fifth element" por @fernando_cejas
 
AppNotch Enterprise
AppNotch EnterpriseAppNotch Enterprise
AppNotch Enterprise
 
HTML5 or Android for Mobile Development?
HTML5 or Android for Mobile Development?HTML5 or Android for Mobile Development?
HTML5 or Android for Mobile Development?
 
Develop an app for Windows 8 using HTML5
Develop an app for Windows 8 using HTML5Develop an app for Windows 8 using HTML5
Develop an app for Windows 8 using HTML5
 
Putting together a web app
Putting together a web appPutting together a web app
Putting together a web app
 
Android quick talk
Android quick talkAndroid quick talk
Android quick talk
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile design
 
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptxLATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
 
HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do That
 
Developing Windows Phone 8 apps using PhoneGap
Developing Windows Phone 8 apps using PhoneGapDeveloping Windows Phone 8 apps using PhoneGap
Developing Windows Phone 8 apps using PhoneGap
 

More from Mihail Mateev

Using SQL Local Database in Mobile Applications
Using SQL Local Database in Mobile ApplicationsUsing SQL Local Database in Mobile Applications
Using SQL Local Database in Mobile Applications
Mihail Mateev
 
Spatial Data with SQL Server Reporting Services
Spatial Data with SQL Server Reporting ServicesSpatial Data with SQL Server Reporting Services
Spatial Data with SQL Server Reporting Services
Mihail Mateev
 

More from Mihail Mateev (6)

Dealing with Azure Cosmos DB
Dealing with Azure Cosmos DBDealing with Azure Cosmos DB
Dealing with Azure Cosmos DB
 
Clash of Technologies Google Cloud vs Microsoft Azure
Clash of Technologies Google Cloud vs Microsoft AzureClash of Technologies Google Cloud vs Microsoft Azure
Clash of Technologies Google Cloud vs Microsoft Azure
 
Devday 2014 using_afs_in_your_cloud_app
Devday 2014 using_afs_in_your_cloud_appDevday 2014 using_afs_in_your_cloud_app
Devday 2014 using_afs_in_your_cloud_app
 
Cloud conf-varna-2014-mihail mateev-spatial-data-and-microsoft-azure-sql-data...
Cloud conf-varna-2014-mihail mateev-spatial-data-and-microsoft-azure-sql-data...Cloud conf-varna-2014-mihail mateev-spatial-data-and-microsoft-azure-sql-data...
Cloud conf-varna-2014-mihail mateev-spatial-data-and-microsoft-azure-sql-data...
 
Using SQL Local Database in Mobile Applications
Using SQL Local Database in Mobile ApplicationsUsing SQL Local Database in Mobile Applications
Using SQL Local Database in Mobile Applications
 
Spatial Data with SQL Server Reporting Services
Spatial Data with SQL Server Reporting ServicesSpatial Data with SQL Server Reporting Services
Spatial Data with SQL Server Reporting Services
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
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
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Win j svsphonegap-damyan-petev-mihail-mateev

  • 1. Windows store apps: WinJS vs PhoneGap Damyan Petev Technical Evangelist, Infragistics dpetev@infragistics.com @DamyanPetev Mihail Mateev Senior Technical Evangelist, Infragistics mmateev@infragistics.com @MihailMateev
  • 2. Agenda • • • • • • Windows Store Apps Intro WinJS and all that madness Similarities and differences PhoneGap Resources Q&A
  • 4. Principals • • • • • Pride in craftsmanship Fast and fluid Authentically digital Do more with less Win as one
  • 5. WinJS • Controls and other UI building blocks for Modern UI style apps • Style sheets with default Modern UI style design • Common infrastructure for responsive, HTML / CSS • Powerful engine for creating user interfaces • Reuse skills & code from the standard web • New HTML / CSS features give you the capabilities to make great UI/UX WinRT • Seamlessly integrate with the Modern UI style shell • Connect to other apps through contracts • Access storage, devices, and other capabilities of the PC
  • 7.
  • 8. IE is ok these days! • Like, it actually is!
  • 9. Why WinJS Apps If You are a web developer today … Build Native Apps With Your Existing Skill Set and Experience (mostly ) – – – – Familiar programming model Full benefit of hardware acceleration WinRT API & feature access Popular JavaScript libraries work in WinJS apps - jQuery, Ignite UI, Knockout, Angular, game engines, etc
  • 10. WinJS.xhr HTML/DOM Utils WinJS Element Attributes Logging Utils WinJS WinJS.Promise Element Selection/ Querying Keyboard Key Enumeration Validation WinJS WinJS.PromiseStat eMachine Coordinate Conversion Support for WinJS declarative model (supportedForProc essing) Class definition and inheritance WinJS.Class Namespace definition utilities WinJS.Namespace WinJS.ErrorFro mName Localized String Utilities Data-win-res processing Semantic Zoom ViewBox ListView Flyout SettingsFlyout Menu Menu Command GridLayout ListLayout WinJS Toolkits Support for declarative model (processAll) Controls Utilities ( setOptions) IZoomableView Custom Layout Interface AppBar IListBinding Fragment loading and rendering WinJS.UI.Fragments IListDataSource IListDataAdapte r IListN H DataSourceStatus StorageDataSo urce VirtualizedData Source Erro FlipView WinJS.UI. Animation helpers Animation Library Data Binding (as, bind) Mixins WinJS.Binding. List Conversions List Projections Support for declarative databinding Animation System Management Application Events WinJS. Application. sessionState WinJS.Navigation Functions local (storage) roaming (storage) temp (storage) WinJS.UI.Pages. PageControl WinJS.Binding. Template WinJS.UI.Pages. IPageControlM embers Tooltip Rating TabContainer TimePicker DatePicker ToggleSwitch HTMLControl Light StyleSheet Dark StyleSheet
  • 11. Personality What Makes a Windows Store App a Windows Store App? • • • • • • • • • Fast & Fluid Live Tiles Animations Transitions Charms AppBar Search Contracts Device Access
  • 13. Extra UI at no cost App Bar Settings
  • 14. Windows UI Apps feature adaptive layouts : Layouts • • • Multiple screen size support Snapped and filled view states Handle rotation CSS Layouts : • CSS Grid, CSS Flexbox, CSS Multicolumn, Media Queries • Fast & Fluid Native performance X Full View Snapped View X Fill View
  • 15. Transforms & Animations CSS & WinJS Animation Library Page transition Content transition Fade in/out Crossfade Pointer up/down Expand/Collapse Reposition Show/Hide popup Show/Hide edge UI Show/Hide panel Add/Delete from list Add/Delete from search list Peek Badge update Start/End a drag or drag-between Swipe hint Swipe select/deselect
  • 16. Touch, Pan, Zoom, Scroll Fast & Fluid Interaction via CSS Windows Store Apps feature direct manipulation panning and zooming of content as a predominant user interface paradigm. CSS gives you: • Support touch, mouse, and keyboard • “Stick to the finger” experience for panning and zooming • Consistent user experience with rails, inertia, and boundary feedback • Support for snap points, nesting, and chaining
  • 17. WinJS Stylesheets Styling an App • Beautiful Dark & Light styles are built in • Well defined, meaningful selectors you can easily understand and override • Visual Studio templates help a lot
  • 18.
  • 19. default.css • Transparent to developers • Provides styles for: – Base elements (HTML, Body, Iframe…) – Text elements (H1, P, DD…) – HTML controls (checkbox, radio button, range…) – WinJS controls (ratings, toggle…) – Additional text element style classes (title, subtitle, item text…) – Additional HTML control style classes (back button…)
  • 20. Built-in styling classes <!– Get a custom back button look --> <button class="win-backbutton"></button> <h1 class="win-title">win-title</h1> <h1 class="win-contentTitle">wincontentTitle</h1> <h1 class="win-contentSubtitle">wincontentSubtitle</h1>
  • 21. ALM
  • 22. Is it really the same?
  • 23. Of standards and popular terms Modern patterns and practices you might know/have seen • Strict mode • Promises [ async ] • SPA
  • 24. I’ll get back to you.. I promise!* from the callback with love var promise = doSomeWork(); promise.then(function(foo){ // continue working here return doSomeMoreWork(); }).then(function(result){ // … }); *but can’t promise to solve all your problems.
  • 25. SPA
  • 26. Single Page App • Web is stateless in nature • Navigation means loosing context • Apps shouldn’t be like that, so:
  • 27. SPA • Keeping it familiar… <!-- A hyperlink to page2.html. --> <p><a href="/pages/page2/page2.html">Go to page 2.</a></p>
  • 29. Pages & Navigation Application Shell Page Content • Navigation template • AppBar integration • Load and [unload] chunks of HTML + CSS + JS • Page content can be dynamic including other WinJS controls within it • Context & State are maintained A series of events to control the process: Before Navigate before navigation attempt Navigating navigating away from a page Navigated
  • 30. The platform differences • No alert  • ms-appx:/// vs. http(s):// vs. file:/// vs. ms-appdata:/// X X • DOM Security - With great power come.. great restrictions :) Still OK : • window.close() //quite useless though • createElement
  • 31. Not in the face !!111!1!! • If ( using DOM) filter through toStaticHTML() – – – – – – • • createContextualFragment innerHTML / outerHTML insertAdjacentHTML pasteHTML document.write / document.writeln DOMParser.parseFromString WinJS.Utilities.markSupportedForProcessing(functionName); Alternative? var someElement = document.getElementById('someElementID'); MSApp.execUnsafeLocalFunction( function() { someElement.innerHTML = '<div onclick="console.log("hi");">hi</div>' });
  • 32. Controls + Data Binding • Rating: <div id="Div1" data-win-control="WinJS.UI.Rating" data-win-bind="winControl.averageRating: rating" data-win-options="{maxRating:5}"></div> • AppBar: <div id="appbar" data-win-control="WinJS.UI.AppBar"> <button data-win-control="WinJS.UI.AppBarCommand“.. • Navigation container: <div id="contenthost" data-win-control="Application.PageControlNavigator" data-win-options="{home: '/pages/home/home.html'}"> </div>
  • 34. Debug • DOM Explorer and JavaScript Console • Remote Debug • Simulation of states • VS 2013 – Performance and Diagnostics
  • 35.
  • 37. Why PhoneGap? • There are more than 100 000 000 WEB developers! • The web is awesome!
  • 38. What is PhoneGap ? Your Code
  • 39. What is PhoneGap ? Your Code Native Web View
  • 40. What is PhoneGap ? Your Code Native Web View Native APIs
  • 41. What is PhoneGap ? Your Code Native Web View Native APIs Native App - .apk, .xap, etc.
  • 42. What is PhoneGap ? • PhoneGap / Cordova for Windows Store App uses WinJS • There is no “special” cordova Web View for WinRT
  • 43. PhoneGap / Cordova API • • • • • • Accelerometer Camera Capture (video) Compass Connection Contacts • • • • • • • Device File IO Geolocation Globalization Media Notifications Storage (database)
  • 44. PhoneGap / Cordova Platforms
  • 45. PhoneGap / Cordova Platforms
  • 46. PhoneGap / Cordova CLI Requires Node.js $ npm install -g cordova $ cordova create hello com.example.hello HelloWorld $ cordova platform add windows8 $ cordova run windows8 $ cordova emulate windows8 $ cordova platform update windows8
  • 47. Debugging PhoneGap for Windows Store Apps: • 2 ways to debug PhoneCap/Windows 8.x App – As WinJS App – As PhoneGap App (winery, http://debug.phonegap.com/)
  • 48. Naturally, apps targeted at 8.1 don’t get scaled down for Win 8. So yeah, there’s that.
  • 49. The take away • WinJS vs PhoneGap is a matter of API preference and code portability • Windows Store basic rules apply to PhoneGap • Do whatever you feel like, as long as you: – Stay within platform look and feel – Understand the sandbox model of the app • Mash up frameworks and tools: – Should be compatible (like jQuery 2.x) – Or use workarounds
  • 50. • Състезание 1: Windows 8.1 или Windows Phone 8 http://bgapps.promorc.com/ • Състезание 2: Win 8 app – Best UX – Most Innovative – Best migrated from WP – More worldwide http://winappdevcon.promorc.com
  • 51. Resources • The ‘everything you need and more’ place: – http://msdn.microsoft.com/en-US/windows/apps/ • Windows 8 samples: – http://code.msdn.microsoft.com/windowsapps/Windows-8-app-samples-4d76cbbf • Windows 8.1 Samples: – http://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-AppSamples • Free ebook: Programming Windows Store Apps with HTML, CSS, and JavaScript, Second Edition (second preview): • http://aka.ms/secondedition/secondpreview http://blogs.msdn.com/b/microsoft_press/archive/2013/10/29/free-ebook-programmingwindows-store-apps-with-html-css-and-javascript-second-edition-second-preview.aspx
  • 52. Resources & Q&A • • • WinJS for the PhoneGap developer blog series: – http://blogs.msdn.com/b/glengordon/ Windows 8 Platform Guide – http://docs.phonegap.com/en/edge/guide_platforms_win8_index.md.html Next event: Building your first Analysis Services solution (11 of February, 2014) – Speaker: Ivan Donev
  • 53. Resources & Q&A • Next conference: Azure Bootcamp Bulgaria (29 of Mach, 2014)