SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Busy Developer's Guide
     to Windows 8 HTML/JavaScript Apps


                 Ted Neward
             Neward & Associates
http://www.tedneward.com | ted@tedneward.com
Credentials

Who is this guy?
   – Architectural Consultant, Neudesic Software
   – Principal, Architect, Consultant and Mentor
      ask me how I can help your project or your team
   – Microsoft MVP (F#, C#, Architect)
   – JSR 175, 277 Expert Group Member
   – Author
      Professional F# 2.0 (w/Erickson, et al; Wrox, 2010)
      Effective Enterprise Java (Addison-Wesley, 2004)
      C# In a Nutshell (w/Drayton, et all; OReilly, 2003)
      SSCLI Essentials (w/Stutz, et al; OReilly, 2003)
      Server-Based Java Programming (Manning, 2000)
   – Blog: http://blogs.tedneward.com
   – Papers: http://www.tedneward.com/writings
Objectives

Our goals...
    – to understand how to build a Windows 8 app in
      HTML/JavaScript
    – to understand why you want to do this
    – to understand why Microsoft wants you to do this
    – to understand where this fits in relation to .NET/C++/Web
    – to begin the path of deeper understanding
Disclaimer

Note that...
    – attending this talk will NOT make you an expert
    – I am also NOT an expert
    – Windows 8 hasn't shipped yet (technically)
This talk will get you started, try to debunk some of
   the popular conspiracy theories, and put some
   strategic overview on the whole thing
       that's it
Getting Started

Writing an app for Windows 8 in HTML/JavaScript
  requires
   – Windows 8 (seriously)
   – Visual Studio 2012 (either Express or full-blown)
      http://msdn.microsoft.com/en-us/windows/apps/br229516
   – Optionally, Microsoft samples and/or hands-on labs (HOL)
   – There are no (known) command-line tools to do this
Hello World

Once Win 8 and VS 2012 are installed
   – fire up the Hello World of Win8HTMLJS apps
   – File->New Project->JavaScript->Windows Store->Blank App
      •creates a single-page Metro HTML/JS App
      •first time, a "Developer License" dialog pops up; this is to
      obtain a crypto key for signing the app
   – hit "F5" and it will build and run on the local box
     (LocalMachine)
      you can also run it in the Simulator, which simulates tablets if
      you're not on one
Concepts


'Big picture' kinds of things
Concepts

What just happened?
   – VS built a project out of HTML and CSS and JavaScript
   – the app was bundled up into a "package" (a zip file)
   – the app contains a "package.appxmanifest" file that
     contains app metadata
   – the app was signed with a crypto key and deployed to the
     local machine
      C:Program FilesWindowsApps (which is protected up the
      wazoo!)
Concepts

What just happened?
   – when executed, a host process (WWAHost.exe) fired up
   – the IE 10 "Trident" HTML/CSS engine displayed the HTML
   – the IE 10 "Chakra" JS engine executed the JS
   – the application runs in a sandbox with no user privileges
Concepts

Your "executable" application essentially isn't
    – it's a Web app running entirely on the local machine
    – it's a native app with access to the underlying machine
    – it's Frankenstein's monster!
       maybe we should call it "Ballmerstein's Monster"?
Concepts

Metro apps aren't quite like traditional desktop apps
    – think more of a "fusion" of web and desktop
    – with some mobile ideas thrown in
As a result, UI approaches will need/want to be
   different
    – "Tiles" (shortcuts into your app's data or tasks)
    – "Live tiles" (representations of data easily seen)
    – "Chromelessness" (absence of window decorations)
    – "Charms" (toolbar off to the right of the screen)
    – "App Bars" (sort of like toolbars, but simpler/cleaner)
Concepts

WinRT
   – Windows Runtime API
        not to be confused with "Windows RT" (Windows on ARM)
   – essentially an API layer on top of the Windows kernel
   – provides O-O metadata similar to JVM/CLR runtimes
   – provides "projections" into different languages
        C#, VB, C++, and JavaScript (WinJS)
Concepts

Contracts
   – this is the new COM (sort of)
      programs advertise and consume contracts
   – essentially an IPC declaration mechanism
   – used for Search, drag and drop, app targets, and so on
Code


Show me the code!
Code

UI elements are defined in HTML
   – or can be added/manipulated later by DOM magic
   – all "basic" HTML controls are supported
       button, checkbox, drop-down list, email, file upload,
      hyperlink, listbox, text, password, progress, radiobutton, rich
      text, slider, uri, ...
   – WinJS also offers a few "custom" controls unique to Metro
      DatePicker, TimePicker, Rating, ToggleSwitch, Tooltip
Code

<body>
• <h1 class="headerClass">Hello, world!</h1>
• <div class="mainContent">
•     <p>What's your name?</p>
•     <input id="nameInput" type="text" />
•     <button id="helloButton">Say "Hello"</button>
•     <div id="greetingOutput"></div>
•     <label for="ratingControlDiv">
•        Rate this greeting:
•     </label>
•     <div id="ratingControlDiv" data-win-
control="WinJS.UI.Rating"></div>
•     <div id="ratingOutput"></div>
• </div>
•</body>
Code

UI styles are defined in CSS
    – Metro defines two parallel stylesheets for your use
       ui-light.css and ui-dark.css
    – of course, custom styling is always possible
       but until Metro gains widespread acceptance, resist
Much of the intent is to do styling and UI theming in
  Blend
    – ... and frankly, that's not a programmer tool
Code

body {
•}
•
•.headerClass {
• margin-top: 45px;
• margin-left: 120px;
•}
•
•.mainContent {
• margin-top: 31px;
• margin-left: 120px;
• margin-bottom: 50px;
•}
•
•#greetingOutput {
• height: 20px;
• margin-bottom: 40px;
•}
Code

UI events are handled in JavaScript
    – just as with Web, register a JS function with the event in
      question
       typically do this on app startup
    – and, of course, events can be registered/unregistered
      dynamically
Code

(function () {
• "use strict";
•
• // ...
•
• function buttonClickHandler(eventInfo) {
• var userName = document.getElementById("nameInput").value;
• var greetingString = "Hello, " + userName + "!";
• document.getElementById("greetingOutput").innerText =
greetingString;
• }
• function ratingChanged(eventInfo) {
• var ratingOutput = document.getElementById("ratingOutput");
• ratingOutput.innerText = eventInfo.detail.tentativeRating;
• }
•}
Code

(function () {
• "use strict";
•
• // ...
•
• app.onactivated = function (args) {
• if (args.detail.kind === activation.ActivationKind.launch) {
•     // ...
•     args.setPromise(WinJS.UI.processAll().then(function
completed() {
•        var ratingControlDiv =
document.getElementById("ratingControlDiv");
•        var ratingControl = ratingControlDiv.winControl;
•        ratingControl.addEventListener("change", ratingChanged,
false);
•        var helloButton = document.getElementById("helloButton");
•        helloButton.addEventListener("click", buttonClickHandler,
false);
•     }));
• }
• };
•
• // ...
•}
Analysis


Why did they do this?
Analysis

Web applications have dominated the industry for a
  decade
   – HTML/CSS/Javascript skills are ubiquitous
   – Web concepts are emerging into desktop applications
   – some users can't tell the difference between the two
   – more and more data is living in "the cloud"
      Dropbox, SkyDrive, Evernote, iTunes, Amazon, ...
Analysis

Conspiracies! Everywhere!
   – Is this Microsoft's attempt to kill the Web?
   – Is this Microsoft's attempt to kill HTML 5?
   – Is this Microsoft trying to "embrace, extend, extinguish"?
   – Is this the beginning of the end of the world as we know it?
Analysis

Microsoft wants people to write apps for their
   platform
   – this is hardly surprising, new, or unacceptable
   – part of this means making the platform easy to program
     for
   – part of this means making it "easy" for people to port code
      frankly I don't see this as being a big play
Microsoft wants people to buy apps on their
   platform
   – this means reducing the barrier to entry (AppStore)
   – this means making them easier to obtain (Internet)
   – this means putting some "borders" around apps (security,
     safety, etc), and this is easier with interpreted code than
Summary

Windows 8 apps are interesting to a certain crowd
   – this doesn't mean everybody will want to build one
   – in fact, if you're not a historic Microsoft developer, you
     probably won't
   – the concept of using HTML+Javascript to build a "native"
     app is interesting

Weitere ähnliche Inhalte

Was ist angesagt?

JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SKJavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SKDavid Wesst
 
Introduction to html5 game programming with ImpactJs
Introduction to html5 game programming with ImpactJsIntroduction to html5 game programming with ImpactJs
Introduction to html5 game programming with ImpactJsLuca Galli
 
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 XPagesTeamstudio
 
Appcelerator Titanium - An Introduction to the Titanium Ecosystem
Appcelerator Titanium - An Introduction to the Titanium EcosystemAppcelerator Titanium - An Introduction to the Titanium Ecosystem
Appcelerator Titanium - An Introduction to the Titanium EcosystemBoydlee Pollentine
 
Tech days faridabad
Tech days  faridabadTech days  faridabad
Tech days faridabadAnkur Mishra
 
Introduction to Keyboard Navigation and Accessibility
Introduction to Keyboard Navigation and AccessibilityIntroduction to Keyboard Navigation and Accessibility
Introduction to Keyboard Navigation and AccessibilityMatthew Deeprose
 
The Next Generation of Flash User Experience
The Next Generation of Flash User ExperienceThe Next Generation of Flash User Experience
The Next Generation of Flash User ExperienceKevin Suttle
 
jQuery Comes to XPages
jQuery Comes to XPagesjQuery Comes to XPages
jQuery Comes to XPagesTeamstudio
 
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 buildMonika Piotrowicz
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery PluginsMarc Grabanski
 
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 HTML5Soumow Dollon
 
Lastest Trends in Web Development
Lastest Trends in Web DevelopmentLastest Trends in Web Development
Lastest Trends in Web DevelopmentDoris Chen
 
10 Simple Rules for Making My Site Accessible
10 Simple Rules for Making My Site Accessible10 Simple Rules for Making My Site Accessible
10 Simple Rules for Making My Site AccessibleHelena Zubkow
 
Building Web Sites that Work Everywhere
Building Web Sites that Work EverywhereBuilding Web Sites that Work Everywhere
Building Web Sites that Work EverywhereDoris Chen
 
5 Reasons Why Your Website Is[n’t] a Native App (PrDC 2015)
5 Reasons Why Your Website Is[n’t] a Native App (PrDC 2015)5 Reasons Why Your Website Is[n’t] a Native App (PrDC 2015)
5 Reasons Why Your Website Is[n’t] a Native App (PrDC 2015)David Wesst
 
Learning to be IDE Free (PrDC 2015)
Learning to be IDE Free (PrDC 2015)Learning to be IDE Free (PrDC 2015)
Learning to be IDE Free (PrDC 2015)David Wesst
 
The 5 Layers of Web Accessibility
The 5 Layers of Web AccessibilityThe 5 Layers of Web Accessibility
The 5 Layers of Web AccessibilityDirk Ginader
 
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptjQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptPhilipp Bosch
 

Was ist angesagt? (20)

JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SKJavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
 
Introduction to html5 game programming with ImpactJs
Introduction to html5 game programming with ImpactJsIntroduction to html5 game programming with ImpactJs
Introduction to html5 game programming with ImpactJs
 
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
 
Appcelerator Titanium - An Introduction to the Titanium Ecosystem
Appcelerator Titanium - An Introduction to the Titanium EcosystemAppcelerator Titanium - An Introduction to the Titanium Ecosystem
Appcelerator Titanium - An Introduction to the Titanium Ecosystem
 
May 2014-webinar
May 2014-webinarMay 2014-webinar
May 2014-webinar
 
Tech days faridabad
Tech days  faridabadTech days  faridabad
Tech days faridabad
 
Introduction to Keyboard Navigation and Accessibility
Introduction to Keyboard Navigation and AccessibilityIntroduction to Keyboard Navigation and Accessibility
Introduction to Keyboard Navigation and Accessibility
 
The Next Generation of Flash User Experience
The Next Generation of Flash User ExperienceThe Next Generation of Flash User Experience
The Next Generation of Flash User Experience
 
jQuery Comes to XPages
jQuery Comes to XPagesjQuery Comes to XPages
jQuery Comes to XPages
 
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
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery Plugins
 
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
 
Lastest Trends in Web Development
Lastest Trends in Web DevelopmentLastest Trends in Web Development
Lastest Trends in Web Development
 
10 Simple Rules for Making My Site Accessible
10 Simple Rules for Making My Site Accessible10 Simple Rules for Making My Site Accessible
10 Simple Rules for Making My Site Accessible
 
Building Web Sites that Work Everywhere
Building Web Sites that Work EverywhereBuilding Web Sites that Work Everywhere
Building Web Sites that Work Everywhere
 
5 Reasons Why Your Website Is[n’t] a Native App (PrDC 2015)
5 Reasons Why Your Website Is[n’t] a Native App (PrDC 2015)5 Reasons Why Your Website Is[n’t] a Native App (PrDC 2015)
5 Reasons Why Your Website Is[n’t] a Native App (PrDC 2015)
 
Fewd week4 slides
Fewd week4 slidesFewd week4 slides
Fewd week4 slides
 
Learning to be IDE Free (PrDC 2015)
Learning to be IDE Free (PrDC 2015)Learning to be IDE Free (PrDC 2015)
Learning to be IDE Free (PrDC 2015)
 
The 5 Layers of Web Accessibility
The 5 Layers of Web AccessibilityThe 5 Layers of Web Accessibility
The 5 Layers of Web Accessibility
 
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptjQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
 

Andere mochten auch

Quick guide to using Samsung S8003 for Ko
Quick guide to using Samsung S8003 for KoQuick guide to using Samsung S8003 for Ko
Quick guide to using Samsung S8003 for KoJohn Young
 
Объекты, выставленные на торги по программе Доктор рядом
Объекты, выставленные на торги по программе Доктор рядом Объекты, выставленные на торги по программе Доктор рядом
Объекты, выставленные на торги по программе Доктор рядом tendermosru
 
Beyond Copywriting (PresenTHINK 2015)
Beyond Copywriting (PresenTHINK 2015)Beyond Copywriting (PresenTHINK 2015)
Beyond Copywriting (PresenTHINK 2015)Teodora Petkova
 
nhận làm video quảng cáo 3d
nhận làm video quảng cáo 3dnhận làm video quảng cáo 3d
nhận làm video quảng cáo 3dtheo757
 
Wind energy 2012 poland
Wind energy 2012 polandWind energy 2012 poland
Wind energy 2012 polandFRACTAL GROUP
 
DB Systems Transmitter Deck
DB Systems Transmitter DeckDB Systems Transmitter Deck
DB Systems Transmitter DeckKurt Ludwig
 
0514 matthew 1019 do not worry about what power point church sermon
0514 matthew 1019 do not worry about what power point church sermon0514 matthew 1019 do not worry about what power point church sermon
0514 matthew 1019 do not worry about what power point church sermonPowerPoint_Sermons
 
Roof Coatings Presentation
Roof Coatings PresentationRoof Coatings Presentation
Roof Coatings PresentationPaul Hannam
 
Startups + Crowdfunding
Startups + CrowdfundingStartups + Crowdfunding
Startups + CrowdfundingRomagna Tech
 
2012 Budget Day Presentation
2012 Budget Day Presentation2012 Budget Day Presentation
2012 Budget Day PresentationEmpowerLA
 
Yee San Su - Food Chain Reaction: A Global Food Security Game
Yee San Su - Food Chain Reaction: A Global Food Security GameYee San Su - Food Chain Reaction: A Global Food Security Game
Yee San Su - Food Chain Reaction: A Global Food Security GameSeriousGamesAssoc
 
Toan van diem moi luat doanh nghiep 2014
Toan van diem moi luat doanh nghiep 2014Toan van diem moi luat doanh nghiep 2014
Toan van diem moi luat doanh nghiep 2014Hung Nguyen
 
Org. molecules pres.
Org. molecules pres.Org. molecules pres.
Org. molecules pres.rksteel
 

Andere mochten auch (18)

Quick guide to using Samsung S8003 for Ko
Quick guide to using Samsung S8003 for KoQuick guide to using Samsung S8003 for Ko
Quick guide to using Samsung S8003 for Ko
 
Объекты, выставленные на торги по программе Доктор рядом
Объекты, выставленные на торги по программе Доктор рядом Объекты, выставленные на торги по программе Доктор рядом
Объекты, выставленные на торги по программе Доктор рядом
 
Magazine Projectfinal final
Magazine Projectfinal finalMagazine Projectfinal final
Magazine Projectfinal final
 
Beyond Copywriting (PresenTHINK 2015)
Beyond Copywriting (PresenTHINK 2015)Beyond Copywriting (PresenTHINK 2015)
Beyond Copywriting (PresenTHINK 2015)
 
nhận làm video quảng cáo 3d
nhận làm video quảng cáo 3dnhận làm video quảng cáo 3d
nhận làm video quảng cáo 3d
 
Curriculum vitae
Curriculum vitaeCurriculum vitae
Curriculum vitae
 
Wind energy 2012 poland
Wind energy 2012 polandWind energy 2012 poland
Wind energy 2012 poland
 
DB Systems Transmitter Deck
DB Systems Transmitter DeckDB Systems Transmitter Deck
DB Systems Transmitter Deck
 
0514 matthew 1019 do not worry about what power point church sermon
0514 matthew 1019 do not worry about what power point church sermon0514 matthew 1019 do not worry about what power point church sermon
0514 matthew 1019 do not worry about what power point church sermon
 
Roof Coatings Presentation
Roof Coatings PresentationRoof Coatings Presentation
Roof Coatings Presentation
 
Startups + Crowdfunding
Startups + CrowdfundingStartups + Crowdfunding
Startups + Crowdfunding
 
2012 Budget Day Presentation
2012 Budget Day Presentation2012 Budget Day Presentation
2012 Budget Day Presentation
 
Yee San Su - Food Chain Reaction: A Global Food Security Game
Yee San Su - Food Chain Reaction: A Global Food Security GameYee San Su - Food Chain Reaction: A Global Food Security Game
Yee San Su - Food Chain Reaction: A Global Food Security Game
 
Chuong 5a
Chuong 5aChuong 5a
Chuong 5a
 
Toan van diem moi luat doanh nghiep 2014
Toan van diem moi luat doanh nghiep 2014Toan van diem moi luat doanh nghiep 2014
Toan van diem moi luat doanh nghiep 2014
 
Questionnaire
QuestionnaireQuestionnaire
Questionnaire
 
Org. molecules pres.
Org. molecules pres.Org. molecules pres.
Org. molecules pres.
 
haftalik dusunce ozgurlugu bulteni_13.05.31_22
haftalik dusunce ozgurlugu bulteni_13.05.31_22 haftalik dusunce ozgurlugu bulteni_13.05.31_22
haftalik dusunce ozgurlugu bulteni_13.05.31_22
 

Ähnlich wie Busy Developer's Guide to Windows 8 HTML/JavaScript Apps

HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do ThatNathan Smith
 
Win j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevWin j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevMihail Mateev
 
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Heiko Behrens
 
openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010Patrick Lauke
 
Thug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclientThug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclientAngelo Dell'Aera
 
Windows Phone and Windows 8 application development
Windows Phone and Windows 8 application developmentWindows Phone and Windows 8 application development
Windows Phone and Windows 8 application developmentChristos Matskas
 
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 FrameworkSt. Petersburg College
 
webOS App by Example: Sorting Thoughts
webOS App by Example: Sorting ThoughtswebOS App by Example: Sorting Thoughts
webOS App by Example: Sorting ThoughtsHendrik Ebel
 
Empowering the “Mobile Web” with Chris Mills
Empowering the “Mobile Web” with Chris MillsEmpowering the “Mobile Web” with Chris Mills
Empowering the “Mobile Web” with Chris MillsFITC
 
Empowering the Mobile Web - Mills
Empowering the Mobile Web - MillsEmpowering the Mobile Web - Mills
Empowering the Mobile Web - MillsCodemotion
 
Empowering the "mobile web"
Empowering the "mobile web"Empowering the "mobile web"
Empowering the "mobile web"Chris Mills
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titaniumNaga Harish M
 
Enjoying the full stack - Frontend 2010
Enjoying the full stack - Frontend 2010Enjoying the full stack - Frontend 2010
Enjoying the full stack - Frontend 2010Christian Heilmann
 
Claim Academy Intro to Programming
Claim Academy Intro to ProgrammingClaim Academy Intro to Programming
Claim Academy Intro to ProgrammingAlex Pearson
 
Lesson learned from 3 years with hybrid apps
Lesson learned from 3 years with hybrid appsLesson learned from 3 years with hybrid apps
Lesson learned from 3 years with hybrid appsPatrik Malmquist
 
Titanium Overview (Mobile March 2011)
Titanium Overview (Mobile March 2011)Titanium Overview (Mobile March 2011)
Titanium Overview (Mobile March 2011)Kevin Whinnery
 
Front End Development | Introduction
Front End Development | IntroductionFront End Development | Introduction
Front End Development | IntroductionJohnTaieb
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumTechday7
 

Ähnlich wie Busy Developer's Guide to Windows 8 HTML/JavaScript Apps (20)

HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do That
 
Win j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevWin j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateev
 
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
 
openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010
 
Thug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclientThug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclient
 
Windows Phone and Windows 8 application development
Windows Phone and Windows 8 application developmentWindows Phone and Windows 8 application development
Windows Phone and Windows 8 application development
 
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
 
Intro to Android Programming
Intro to Android ProgrammingIntro to Android Programming
Intro to Android Programming
 
webOS App by Example: Sorting Thoughts
webOS App by Example: Sorting ThoughtswebOS App by Example: Sorting Thoughts
webOS App by Example: Sorting Thoughts
 
1_Intro_toHTML.ppt
1_Intro_toHTML.ppt1_Intro_toHTML.ppt
1_Intro_toHTML.ppt
 
Empowering the “Mobile Web” with Chris Mills
Empowering the “Mobile Web” with Chris MillsEmpowering the “Mobile Web” with Chris Mills
Empowering the “Mobile Web” with Chris Mills
 
Empowering the Mobile Web - Mills
Empowering the Mobile Web - MillsEmpowering the Mobile Web - Mills
Empowering the Mobile Web - Mills
 
Empowering the "mobile web"
Empowering the "mobile web"Empowering the "mobile web"
Empowering the "mobile web"
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titanium
 
Enjoying the full stack - Frontend 2010
Enjoying the full stack - Frontend 2010Enjoying the full stack - Frontend 2010
Enjoying the full stack - Frontend 2010
 
Claim Academy Intro to Programming
Claim Academy Intro to ProgrammingClaim Academy Intro to Programming
Claim Academy Intro to Programming
 
Lesson learned from 3 years with hybrid apps
Lesson learned from 3 years with hybrid appsLesson learned from 3 years with hybrid apps
Lesson learned from 3 years with hybrid apps
 
Titanium Overview (Mobile March 2011)
Titanium Overview (Mobile March 2011)Titanium Overview (Mobile March 2011)
Titanium Overview (Mobile March 2011)
 
Front End Development | Introduction
Front End Development | IntroductionFront End Development | Introduction
Front End Development | Introduction
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator Titanium
 

Mehr von JAX London

Everything I know about software in spaghetti bolognese: managing complexity
Everything I know about software in spaghetti bolognese: managing complexityEverything I know about software in spaghetti bolognese: managing complexity
Everything I know about software in spaghetti bolognese: managing complexityJAX London
 
Devops with the S for Sharing - Patrick Debois
Devops with the S for Sharing - Patrick DeboisDevops with the S for Sharing - Patrick Debois
Devops with the S for Sharing - Patrick DeboisJAX London
 
It's code but not as we know: Infrastructure as Code - Patrick Debois
It's code but not as we know: Infrastructure as Code - Patrick DeboisIt's code but not as we know: Infrastructure as Code - Patrick Debois
It's code but not as we know: Infrastructure as Code - Patrick DeboisJAX London
 
Locks? We Don't Need No Stinkin' Locks - Michael Barker
Locks? We Don't Need No Stinkin' Locks - Michael BarkerLocks? We Don't Need No Stinkin' Locks - Michael Barker
Locks? We Don't Need No Stinkin' Locks - Michael BarkerJAX London
 
Worse is better, for better or for worse - Kevlin Henney
Worse is better, for better or for worse - Kevlin HenneyWorse is better, for better or for worse - Kevlin Henney
Worse is better, for better or for worse - Kevlin HenneyJAX London
 
Java performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha GeeJava performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha GeeJAX London
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John StevensonJAX London
 
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias WessendorfHTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias WessendorfJAX London
 
Play framework 2 : Peter Hilton
Play framework 2 : Peter HiltonPlay framework 2 : Peter Hilton
Play framework 2 : Peter HiltonJAX London
 
Complexity theory and software development : Tim Berglund
Complexity theory and software development : Tim BerglundComplexity theory and software development : Tim Berglund
Complexity theory and software development : Tim BerglundJAX London
 
Why FLOSS is a Java developer's best friend: Dave Gruber
Why FLOSS is a Java developer's best friend: Dave GruberWhy FLOSS is a Java developer's best friend: Dave Gruber
Why FLOSS is a Java developer's best friend: Dave GruberJAX London
 
Akka in Action: Heiko Seeburger
Akka in Action: Heiko SeeburgerAkka in Action: Heiko Seeburger
Akka in Action: Heiko SeeburgerJAX London
 
NoSQL Smackdown 2012 : Tim Berglund
NoSQL Smackdown 2012 : Tim BerglundNoSQL Smackdown 2012 : Tim Berglund
NoSQL Smackdown 2012 : Tim BerglundJAX London
 
Closures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel WinderClosures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel WinderJAX London
 
Java and the machine - Martijn Verburg and Kirk Pepperdine
Java and the machine - Martijn Verburg and Kirk PepperdineJava and the machine - Martijn Verburg and Kirk Pepperdine
Java and the machine - Martijn Verburg and Kirk PepperdineJAX London
 
Mongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdamsMongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdamsJAX London
 
New opportunities for connected data - Ian Robinson
New opportunities for connected data - Ian RobinsonNew opportunities for connected data - Ian Robinson
New opportunities for connected data - Ian RobinsonJAX London
 
HTML5 Websockets and Java - Arun Gupta
HTML5 Websockets and Java - Arun GuptaHTML5 Websockets and Java - Arun Gupta
HTML5 Websockets and Java - Arun GuptaJAX London
 
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian Plosker
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian PloskerThe Big Data Con: Why Big Data is a Problem, not a Solution - Ian Plosker
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian PloskerJAX London
 
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...JAX London
 

Mehr von JAX London (20)

Everything I know about software in spaghetti bolognese: managing complexity
Everything I know about software in spaghetti bolognese: managing complexityEverything I know about software in spaghetti bolognese: managing complexity
Everything I know about software in spaghetti bolognese: managing complexity
 
Devops with the S for Sharing - Patrick Debois
Devops with the S for Sharing - Patrick DeboisDevops with the S for Sharing - Patrick Debois
Devops with the S for Sharing - Patrick Debois
 
It's code but not as we know: Infrastructure as Code - Patrick Debois
It's code but not as we know: Infrastructure as Code - Patrick DeboisIt's code but not as we know: Infrastructure as Code - Patrick Debois
It's code but not as we know: Infrastructure as Code - Patrick Debois
 
Locks? We Don't Need No Stinkin' Locks - Michael Barker
Locks? We Don't Need No Stinkin' Locks - Michael BarkerLocks? We Don't Need No Stinkin' Locks - Michael Barker
Locks? We Don't Need No Stinkin' Locks - Michael Barker
 
Worse is better, for better or for worse - Kevlin Henney
Worse is better, for better or for worse - Kevlin HenneyWorse is better, for better or for worse - Kevlin Henney
Worse is better, for better or for worse - Kevlin Henney
 
Java performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha GeeJava performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha Gee
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
 
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias WessendorfHTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
 
Play framework 2 : Peter Hilton
Play framework 2 : Peter HiltonPlay framework 2 : Peter Hilton
Play framework 2 : Peter Hilton
 
Complexity theory and software development : Tim Berglund
Complexity theory and software development : Tim BerglundComplexity theory and software development : Tim Berglund
Complexity theory and software development : Tim Berglund
 
Why FLOSS is a Java developer's best friend: Dave Gruber
Why FLOSS is a Java developer's best friend: Dave GruberWhy FLOSS is a Java developer's best friend: Dave Gruber
Why FLOSS is a Java developer's best friend: Dave Gruber
 
Akka in Action: Heiko Seeburger
Akka in Action: Heiko SeeburgerAkka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
 
NoSQL Smackdown 2012 : Tim Berglund
NoSQL Smackdown 2012 : Tim BerglundNoSQL Smackdown 2012 : Tim Berglund
NoSQL Smackdown 2012 : Tim Berglund
 
Closures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel WinderClosures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel Winder
 
Java and the machine - Martijn Verburg and Kirk Pepperdine
Java and the machine - Martijn Verburg and Kirk PepperdineJava and the machine - Martijn Verburg and Kirk Pepperdine
Java and the machine - Martijn Verburg and Kirk Pepperdine
 
Mongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdamsMongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdams
 
New opportunities for connected data - Ian Robinson
New opportunities for connected data - Ian RobinsonNew opportunities for connected data - Ian Robinson
New opportunities for connected data - Ian Robinson
 
HTML5 Websockets and Java - Arun Gupta
HTML5 Websockets and Java - Arun GuptaHTML5 Websockets and Java - Arun Gupta
HTML5 Websockets and Java - Arun Gupta
 
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian Plosker
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian PloskerThe Big Data Con: Why Big Data is a Problem, not a Solution - Ian Plosker
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian Plosker
 
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...
 

Busy Developer's Guide to Windows 8 HTML/JavaScript Apps

  • 1. Busy Developer's Guide to Windows 8 HTML/JavaScript Apps Ted Neward Neward & Associates http://www.tedneward.com | ted@tedneward.com
  • 2. Credentials Who is this guy? – Architectural Consultant, Neudesic Software – Principal, Architect, Consultant and Mentor ask me how I can help your project or your team – Microsoft MVP (F#, C#, Architect) – JSR 175, 277 Expert Group Member – Author Professional F# 2.0 (w/Erickson, et al; Wrox, 2010) Effective Enterprise Java (Addison-Wesley, 2004) C# In a Nutshell (w/Drayton, et all; OReilly, 2003) SSCLI Essentials (w/Stutz, et al; OReilly, 2003) Server-Based Java Programming (Manning, 2000) – Blog: http://blogs.tedneward.com – Papers: http://www.tedneward.com/writings
  • 3. Objectives Our goals... – to understand how to build a Windows 8 app in HTML/JavaScript – to understand why you want to do this – to understand why Microsoft wants you to do this – to understand where this fits in relation to .NET/C++/Web – to begin the path of deeper understanding
  • 4. Disclaimer Note that... – attending this talk will NOT make you an expert – I am also NOT an expert – Windows 8 hasn't shipped yet (technically) This talk will get you started, try to debunk some of the popular conspiracy theories, and put some strategic overview on the whole thing that's it
  • 5. Getting Started Writing an app for Windows 8 in HTML/JavaScript requires – Windows 8 (seriously) – Visual Studio 2012 (either Express or full-blown) http://msdn.microsoft.com/en-us/windows/apps/br229516 – Optionally, Microsoft samples and/or hands-on labs (HOL) – There are no (known) command-line tools to do this
  • 6. Hello World Once Win 8 and VS 2012 are installed – fire up the Hello World of Win8HTMLJS apps – File->New Project->JavaScript->Windows Store->Blank App •creates a single-page Metro HTML/JS App •first time, a "Developer License" dialog pops up; this is to obtain a crypto key for signing the app – hit "F5" and it will build and run on the local box (LocalMachine) you can also run it in the Simulator, which simulates tablets if you're not on one
  • 8. Concepts What just happened? – VS built a project out of HTML and CSS and JavaScript – the app was bundled up into a "package" (a zip file) – the app contains a "package.appxmanifest" file that contains app metadata – the app was signed with a crypto key and deployed to the local machine C:Program FilesWindowsApps (which is protected up the wazoo!)
  • 9. Concepts What just happened? – when executed, a host process (WWAHost.exe) fired up – the IE 10 "Trident" HTML/CSS engine displayed the HTML – the IE 10 "Chakra" JS engine executed the JS – the application runs in a sandbox with no user privileges
  • 10. Concepts Your "executable" application essentially isn't – it's a Web app running entirely on the local machine – it's a native app with access to the underlying machine – it's Frankenstein's monster! maybe we should call it "Ballmerstein's Monster"?
  • 11. Concepts Metro apps aren't quite like traditional desktop apps – think more of a "fusion" of web and desktop – with some mobile ideas thrown in As a result, UI approaches will need/want to be different – "Tiles" (shortcuts into your app's data or tasks) – "Live tiles" (representations of data easily seen) – "Chromelessness" (absence of window decorations) – "Charms" (toolbar off to the right of the screen) – "App Bars" (sort of like toolbars, but simpler/cleaner)
  • 12. Concepts WinRT – Windows Runtime API not to be confused with "Windows RT" (Windows on ARM) – essentially an API layer on top of the Windows kernel – provides O-O metadata similar to JVM/CLR runtimes – provides "projections" into different languages C#, VB, C++, and JavaScript (WinJS)
  • 13. Concepts Contracts – this is the new COM (sort of) programs advertise and consume contracts – essentially an IPC declaration mechanism – used for Search, drag and drop, app targets, and so on
  • 15. Code UI elements are defined in HTML – or can be added/manipulated later by DOM magic – all "basic" HTML controls are supported button, checkbox, drop-down list, email, file upload, hyperlink, listbox, text, password, progress, radiobutton, rich text, slider, uri, ... – WinJS also offers a few "custom" controls unique to Metro DatePicker, TimePicker, Rating, ToggleSwitch, Tooltip
  • 16. Code <body> • <h1 class="headerClass">Hello, world!</h1> • <div class="mainContent"> • <p>What's your name?</p> • <input id="nameInput" type="text" /> • <button id="helloButton">Say "Hello"</button> • <div id="greetingOutput"></div> • <label for="ratingControlDiv"> • Rate this greeting: • </label> • <div id="ratingControlDiv" data-win- control="WinJS.UI.Rating"></div> • <div id="ratingOutput"></div> • </div> •</body>
  • 17. Code UI styles are defined in CSS – Metro defines two parallel stylesheets for your use ui-light.css and ui-dark.css – of course, custom styling is always possible but until Metro gains widespread acceptance, resist Much of the intent is to do styling and UI theming in Blend – ... and frankly, that's not a programmer tool
  • 18. Code body { •} • •.headerClass { • margin-top: 45px; • margin-left: 120px; •} • •.mainContent { • margin-top: 31px; • margin-left: 120px; • margin-bottom: 50px; •} • •#greetingOutput { • height: 20px; • margin-bottom: 40px; •}
  • 19. Code UI events are handled in JavaScript – just as with Web, register a JS function with the event in question typically do this on app startup – and, of course, events can be registered/unregistered dynamically
  • 20. Code (function () { • "use strict"; • • // ... • • function buttonClickHandler(eventInfo) { • var userName = document.getElementById("nameInput").value; • var greetingString = "Hello, " + userName + "!"; • document.getElementById("greetingOutput").innerText = greetingString; • } • function ratingChanged(eventInfo) { • var ratingOutput = document.getElementById("ratingOutput"); • ratingOutput.innerText = eventInfo.detail.tentativeRating; • } •}
  • 21. Code (function () { • "use strict"; • • // ... • • app.onactivated = function (args) { • if (args.detail.kind === activation.ActivationKind.launch) { • // ... • args.setPromise(WinJS.UI.processAll().then(function completed() { • var ratingControlDiv = document.getElementById("ratingControlDiv"); • var ratingControl = ratingControlDiv.winControl; • ratingControl.addEventListener("change", ratingChanged, false); • var helloButton = document.getElementById("helloButton"); • helloButton.addEventListener("click", buttonClickHandler, false); • })); • } • }; • • // ... •}
  • 23. Analysis Web applications have dominated the industry for a decade – HTML/CSS/Javascript skills are ubiquitous – Web concepts are emerging into desktop applications – some users can't tell the difference between the two – more and more data is living in "the cloud" Dropbox, SkyDrive, Evernote, iTunes, Amazon, ...
  • 24. Analysis Conspiracies! Everywhere! – Is this Microsoft's attempt to kill the Web? – Is this Microsoft's attempt to kill HTML 5? – Is this Microsoft trying to "embrace, extend, extinguish"? – Is this the beginning of the end of the world as we know it?
  • 25. Analysis Microsoft wants people to write apps for their platform – this is hardly surprising, new, or unacceptable – part of this means making the platform easy to program for – part of this means making it "easy" for people to port code frankly I don't see this as being a big play Microsoft wants people to buy apps on their platform – this means reducing the barrier to entry (AppStore) – this means making them easier to obtain (Internet) – this means putting some "borders" around apps (security, safety, etc), and this is easier with interpreted code than
  • 26. Summary Windows 8 apps are interesting to a certain crowd – this doesn't mean everybody will want to build one – in fact, if you're not a historic Microsoft developer, you probably won't – the concept of using HTML+Javascript to build a "native" app is interesting