Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cross-Platform Applications for Windows, Web & Mobile with AngularJS and Cordova

Cross-Platform Applications for Windows, Web & Mobile with AngularJS and Cordova

Originally German session title for the Microsoft Technical Summit 2014 in Berlin. But all slides are in English!

Christian Weyer

November 12, 2014
Tweet

More Decks by Christian Weyer

Other Decks in Programming

Transcript

  1. Today: focus on mobile devices & apps But what is

    mobile, anyway? From a small phone to a large phone to a small tablet to a large tablet to a small desktop – you get it…  We need UX & technologies to realize the Continuous Screen Adaptive user interfaces with optimized user experience With one code base & target architecture The ‚Continuous Screen‘ 4
  2. 7

  3. 8

  4. Technology stack Request/response: Lightweight Web/HTTP APIs ASP .NET Web API

    Bi-directional: Push Services ASP .NET SignalR Token-based security Token & authorization servers Ubiquituous clients Web-based application technologies 9
  5. HTML5 as a Platform HTML5 ~= Semantic markup + CSS3

    + JavaScript An application development platform 11
  6. JavaScript + Markup + CSS3 JavaScript as application language Optionally

    TypeScript AngularJS as application framework: MVVM Alternatives like EmberJS, KnockoutJS Templating frameworks for building views AngularJS has built-in templating Bootstrap as common-base layout system More app-like UX frameworks like WinJS or Materials 12
  7. „I didn‘t know that!“ We can build large-scale applications with

    JavaScript We can have IntelliSense with JavaScript We can debug & profile JavaScript We can use JavaScript for real-time 3D JavaScript slowly gets near-native in performance We can have a fresh look at JavaScript Upcoming ECMAScript6 is a big leap forward 13
  8. MVVM with AngularJS AngularJS is a client-side JavaScript SPA framework

    Tries to take away complexities Tries to prepare the way for ECMAScript6 Tries to prepare the way for Web Components Focus on separation of concerns with patterns Dependency injection Models Views ViewModels 14
  9. Native Web-based Mobile Apps: Cordova Framework & tools to create

    native apps from HTML5/JS codebase Wrapping your HTML5 code into native app shell Hook into platform features & events with APIs Extend app functionality with plugins CLI tools for project creation Still needs native SDKs 16
  10. Native Plugins Plugins are composed of Single JavaScript interface used

    across all platforms Native implementations with platform-specific plugin interfaces Core Cordova APIs are implemented using this architecture Installation via CLI Configuration via config.xml AngularJS integration via ng-cordova 18
  11. Visual Studio Multi-Device Hybrid Apps Visual Studio 2013 extension for

    building Cordova applications (in preview) Easy to setup Takes care of all necessary dependenices in one installer Offers project template to integrate with Cordova Debug Windows Store, Windows Phone, Android straight from VS 19
  12. Automation with Cordova CLI Tools Develop, test & debug in

    browser (primarily) Build native apps with script using Corova CLI commands PowerShell or Bash One code base results in various platform binaries Mix that with node-webkit, optionally 21
  13. Cross-Plattform Apps für Windows, Web & Mobile mit AngularJS und

    Cordova Cross platform != Mobile, and Mobile != Phones/Tablets HTML/JavaScript-based frameworks like AngularJS enable real applications Cordova offers platform & tools for native integration & deployment Secure target architecture with Web APIs, Push services and authorization servers 24
  14. © 2014 Microsoft Corporation. All rights reserved. Because Microsoft must

    respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Vielen Dank! Christian Weyer, Thinktecture AG @christianweyer 25
  15. Samples Simple AngularJS (with ASP .NET Web API) demo https://github.com/ChristianWeyer/UG-ngDemo

    myProducts end-to-end demo application https://github.com/ChristianWeyer/myProducts-End-to-End 28
  16. Addendum Going Desktop with node-webkit & CEF node-webkit allows for

    same approach as Cordova but aiming desktop applications Windows, Linux, MacOS X CEFSharp can be used to integrate web-based technologies into existing Windows applications For migration paths 30