• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Develop an app for Windows 8 using HTML5
 

Develop an app for Windows 8 using HTML5

on

  • 15,699 views

The slides for our presentation during the HTML5 dev conf in San Francisco

The slides for our presentation during the HTML5 dev conf in San Francisco

Statistics

Views

Total Views
15,699
Views on SlideShare
13,983
Embed Views
1,716

Actions

Likes
9
Downloads
274
Comments
1

11 Embeds 1,716

http://soumow.dollon.net 1139
http://julien.dollon.net 487
http://dotnet.developpez.com 18
http://localhost 18
http://www.linkedin.com 18
http://tecnologiaacomil.blogspot.com 14
http://cukor26.chirasu.com 11
http://ams.activemailservice.com 4
https://twitter.com 3
https://si0.twimg.com 2
http://fur-lined26.dodury.com 2
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Develop an app for Windows 8 using HTML5 Develop an app for Windows 8 using HTML5 Presentation Transcript

    • AGENDA
    • I’m a Web developer, I don’t know (atall) Microsoft technologies. I already developed an HTML5 web page. I want to create the Windows 8 app of my page.
    • My existing web page: home.dollon.net
    • Compatible with all last browsers on PC andtablets.Works with HTML5 and CSS3 features,knockout.js, jQuery, less (and node.js web service)
    • DEMO
    • So now, please Microsoft, where is the rightbutton click“Transform this website as a metro style app for Windows8”?
    • It does not exist. And it’s normal.Because you are working for a specific kind of tabletwith native call (new API, new controls…) and NEWdesign style (metro).You are not designing a web page. You are developing anative app.
    • 9 things to migrate your HTML5 app on Windows 8 environment.
    • 0 – which kind of tools I need?* *this point is not included on the counter ☺
    • DEMO
    • 1 - what is a package?
    • a package is a ZIP file Don’t forget to obfuscate your code It’s the ‘executable’ of your project It contains everything (HTML, JS, Manifest..)After installation, the app is located here c:Program FilesWindowsApps
    • You can use PowerShell to deploy it And all packages are signed with certificates
    • 2 – what happens in runtime?
    • The process that hosts/executes a Metro style appusing JavaScript is called WWAHost.exe Your app ‘live’ inside a sandbox without all privileges of the current user
    • Process state transitions A user App is launch an Suspended Terminated running appAn app gets 5 secondes to handle suspend and isnotified when it has been resumedApp is not notified before a termination caused bylow resources
    • 3 – Differences between Metro style app And traditional HTML5 web page
    • ALL*HTML5/CSS3 features are supported *if IE10 “trident” layout engine support it
    • ALL*JavaScript features are supported *if IE10 “Chakra” engine support it
    • Native APIs DOM Events Namespaces Controls Enumerations No Java, Silverlight, Flash and other embedded componentsSome ActiveX controls are disabled
    • So, HTML5, CSS3 and JavaScripthave the same support of web APIs than IE 10 + API from WinRT
    • And you have to know thatseriouslyROCKS!
    • This isn’t just a container like PhoneGap It doesn’t run in a browser
    • REUSE THE SAME CODE Just to see if it works ☺
    • 4 – what is WinRT?
    • Windows RT != WinRT (Windows RT is the Windows 8 version for ARM)
    • WinRT Resides directly on the top of the kernel just like the Win32 APIWinRT APIs are written in unmanaged C++and designed to be object-oriented
    • 5 – what is WinJS?
    • WinJS is the orange layer
    • A language projection exists for .NET and C++ too
    • Windows library for JS Helpers Animations Templates Styles App Model Data Binding Controls Navigation
    • Binding.js Wwaap.jsUi.js Base.js Controls.js Animation.js
    • 6 – Windows Controls
    • Built-in ControlsMetro-UI Styles Touch enabled Native CustomizableAll basic controls Controls Same in XAML
    • AppBarUseful to bring up commandson demandDon’t forget to use Charmsfor some entry points
    • MODIFY THE APP With Windows 8 controls
    • 7 – Multiple Views and Resolutions
    • The principal screen can be at minimum1024x768It exists widescreen (1366x768+)Two other modes: snapview and portait
    • Use three kind of image size (100%,140% and 180%).Depending on the resolutions, imagesare loaded automaticallyImage.jpg Image.scale-180.jpg
    • Use of CSS media queries
    • MODIFY THE APP Screens
    • 7 – Use Contracts
    • Share to export the current contentSearch to find contentFile Picker to allow user to access content fromoutsideSettings to configure the app
    • MODIFY THE APP Contracts
    • 8 – Use Tiles
    • Tiles is the “link” to open your appIt could be a “secondary tiles”Can provide a lot of information (icons,notifications, counter)
    • MODIFY THE APP With Tiles and Splash
    • 9 – Debugging and Performances
    • PerformanceTips & tricks that still work:For safe dynamic content, use innerHTMLLink CSS stylesheets at the top of the pageAvoid inline JavaScript and inline CSS stylesDon’t parse JSON by hand, use JSON.parse
    • A Metro style app using HTML5 is more than a web page …
    • Optimize your landing pageRely on packaged content and local dataUse local images scaled to the right sizeUse WinJS fragments to load parts of your app on demand Defer parsing of unneeded HTML content Delays JavaScript Keeps your DOM small: look-up and manipulations are quicker
    • Further optimizationsDefer some initialization to after the splash screen Start network downloads after initialization Delay loading databasesConsolidate small JS files that are related into larger filesIf you need more time, use an extended splash screen
    • Manage your resourcesKeep a lightweight DOMRelease expensive content, such as media elements, as soonas they are no longer neededHelp the garbage collector Avoid circular references between your elements and JavaScript code Review how you use your Object URLs
    • On suspend, free resources that are easy to recreate Use media content from the user at the screen resolution Tune your app launch time to create great firstimpressions Keep your app alive by minimizing your memory footprint Be responsive, don’t block the UI thread
    • Debugging JavaScript apps is !@#$%^ hard!
    • Debugging with Visual StudioLaunch with debuggingdebugger keywordDebug.enableFirstChanceException(true);JavaScript consoleDOM explorer
    • Debugging with BlendUnderstand your CSS with the Winning Rule and Show SetProperties modeDebug device-state issues with the Platform and StylesPanesCatch grid layout issuesFind parser-generated elements with the Live DOMDiagnose post-interaction problems with Interactive Mode
    • 10 – Deployment But no info now, it still not possible to publish app
    • Result
    • ConclusionSkydrive with all samples / slides / videos: http://sdrv.ms/KsoFUq Webcast of this session on YouTube:
    • Q&A(Don’t hesitate togive us feedbacks ontwitter @juliendollon/ @soumow)