SlideShare a Scribd company logo
Building and testing Windows 8
Metro Style Applications using
     C++,C# and JavaScript



                                    Radu Vunvulea
                             vunvulear@gmail.com
                 http://vunvulearadu.blogspot.com
Who am I?
        {
            “name” : “Radu Vunvulea,
            “company” : “iQuest”,
            “userType” : “enthusiastic”
            “technologies” : [ “.NET”, “JS”, “Azure”, “Web”,
                “Mobile”, “SL” ],
            “w8experience” : [ “2 LoB App”, “1 Travel App”],
            “blog” : “vunvulearadu.blogspot.com”,
            “email” : ”vunvulear@gmail.com”,
            “socialMedia” :
                {
                         “twitter” : “@RaduVunvulea”,
                         “fb” : “radu.vunvulea”
                }
        }
Agenda
•   WinRT
•   Windows 8 Architecture I
•   WinMD
•   Windows 8 Architecture II
•   Windows 8 Profiles
•   Mixing Components
•   Extensibilities points
•   Unit tests
•   Windows 8 App Package
•WinRT
• WinMD
• Chakra
• Windows Kernel Service
• Windows Runtime API
•   CLR, CRT, WinJS
•WinRT
• WinMD
• Chakra
• Windows Kernel Service
• Windows Runtime API
•   CLR, CRT, WinJS
What exactly is WinRT

• WinRT – Windows Runtime
• Allow us to build app that use Windows functionalities
• We can use any kind of language (managed or not)
   •   C#
   •   C++
   •   JavaScript
   •   Visual Basic
• Language projection for any kind of language
• Expose Windows functionalities
• Native for any supported language
What exactly is WinRT

• WinRT – Windows Runtime
• Allow us to build app that use Windows functionalities
• We can use any kind of language (managed or not)
   •   C#
   •   C++
   •   JavaScript
   •   Visual Basic
• Language projection for any kind of language
• Expose Windows functionalities
• Native for any supported language
Why WinRT is good

•   We don’t need to use COM and Win32 anymore – for “Metro Apps”
•   Easy access to Windows features
•   Object lifetime management
•   Same API on different languages
•   A lot of things are supported by default, we don’t need to write
    code for that:
    •   Image capture
    •   IO access
    •   Geolocation
    •   Contracts
    •   Networking
    •   … and so on
Why WinRT is good

•   We don’t need to use COM anymore
•   Easy access to Windows features
•   Object lifetime management
•   Same API on different languages
•   A lot of things are supported by default, we don’t need to write
    code for that:
     •   Image capture
     •   IO access
     •   Geolocation
     •   Contracts
     •   Networking
     •   … and so on
What about WinMD

•   WinMD – Windows Metadata
•   Describe what a WinRT component can do
•   Separate file, not included in the WinRT file
•   Compatible metadata - .NET ECMA-355 (not IDL)
     • This is the secret which make it possible a WinRT object to be
       consumed by
          - native C++
          - managed C#
          - JavaScript using Chakra JS Engine
Windows 8 and WinRT architecture
Windows 8 and WinRT Architecture
Windows 8 and WinRT Architecture

•   Only one CLR for all application (desktop and “Metro Apps”)
•   Different instances for desktop and “Metro Apps”
•   Only one IL for all applications (desktop and “Metro Apps”)
•   Only one MSIL for all applications
•   The same .NET Framework 4.5 is used for all applications, but it used
    different profiles
     •   .NET Client Profile – desktop
     •   .NET Metro Profile – “Metro Apps”
• Framework contains rules that define what parts are available for
  each profile
Windows 8 Profiles

                   .NET




               Silverlight

                       .NET   Windows
                               Phone

                 Windows
                  8 Apps
What should I use?

• JavaScript with HTML 5 and CSS
   + Well Known
   + IndexdDB
   + Dynamic language
   - WinRT not fully available


• C# with XAML
   + Full access to WinRT + some custom libraries
   + async/await, async calls supported at language level
   + Component written for SL or WP7 can be reused
   + Well known
   - XAML can be a hell sometimes


• C++
   + Very fast
   + DirectX (games)
How to mix different components



           C#                  C++




                 Java Script
How to mix different components



           C#                  C++




                                It is not possible


                 Java Script
How to mix different components

• .WinMD describes all the public API exposed by the component
• For JavaScript, the system will manage the class instances
• We don’t need to configure the project that will generate the shared
  component

• Be aware that you cannot have/use
   • XAML controllers in a Java Script app
   • Java Script components in a XAML/C# project
        •   Even if we have a WebView, we don’t have full access


• We can have a C# component that use XAML and use it in a C++
  application that use DirectX
How to create reusable C# components

• Our class that will be exposed have to:
   • Be sealed
   • Be public
   • No virtual
   • The class should not be empty
   • The class should not be abstract
   • All the input and output of collection types need to be
     interfaces (IList)
   • Interfaces are not supported in this moment to be exposed
   • Windows.Foundation.Metadata.DefaultOverload– for overloading
How to create reusable C# components

• Asynchronous calls are supported
• An asynchronous call need to return an IAsyncOperationTReturn>
   • We can obtain it calling “AsAsyncOperation()” method.
• A Task<T> is automatically converted into Promise
• Don’t forget to named your method accordingly
• Any method that’s take longer than 50ms
Demo
What about extensibility…

• It is an important feature for LoB applications

• Dynamic components loading (reflection)
• JS loaded and compiled at runtime

• MEF (Managed Extensibility Framework)
• Prims
What about extensibility…

• It is an important feature for LoB applications

• Dynamic components loading (reflection)
• JS loaded and compiled at runtime

• MEF (Managed Extensibility Framework)
• Prims

• Non-official response
   • Wait, have patience, in 6-9 months we may have something for
     you
Demo
Unit tests
• For code written in C/C++, C# and Visual Basic we have build in
  support for unit tests
Unit tests
• For code written in C/C++, C# and Visual Basic we have build in
  support for unit tests

• What about Java Script?
  • Should we write unit tests for it?
  • Can I run unit tests from Visual Studio 2012?
  • Can I integrate Java Script unit tests to the build machine?
Unit tests
• For code written in C/C++, C# and Visual Basic we have build in
  support for unit tests

• What about Java Script?
  • Should we write unit tests for it? YES
  • Can I run unit tests from Visual Studio 2012? YES
  • Can I integrate Java Script unit tests to the build machine? YES


• There are a lot of frameworks and plugins for this:
   • Chutzpah Test Adapter for Visual Studio 2012
   • QUnit
Demo
Windows 8 App Package

• A package contains all the files that are required by our application
  to run
• An update of our app represent a new version of package that
  contains all the files (not the delta)
• Each package is sign by the author using a unique key
• A package can be created using
    •   Visual Studio
    •   MakeAppX.exe (command line)
Windows 8 App Package

• Every package contains a Package Manifest

• Package Manifest:
   • Package identity
       (package name, version, publisher, processor architecture, resource ID)
   • Package properties
       information about package
   • Capabilities
       a list of application capabilities
   • Extensions
       used to communicate with system and other application
   • Visual elements
       default tile, logo images, background color, and splash screen
Windows 8 App Package

• Each package contains a Power Shell script
• A normal user can install a package only from Marketplace
• Using a developer account any package can be installed on a
  computer (even the packages that are not signed)

• Corporate devices – Windows 8 Enterprise
   • Windows 8 App packages that can be pushed from the
     corporate network without the need to publish the application
     on the Marketplace.
Demo
Radu vunvulea  building and testing windows 8 metro style applications using c++,c# and java script
THE END




                        Radu Vunvulea
                 vunvulear@gmail.com
     http://vunvulearadu.blogspot.com

More Related Content

PPTX
Windows 8 Hot or Not
PPTX
Evolution of .net frame work
PPTX
A walkthrough of JavaScript ES6 features
PPT
Lets Auto It
PPTX
Ionic 2 - Introduction
PPTX
A Developer's View of Windows 8
PPTX
From .NET Core 3, all the rest will be legacy
PDF
What's New in NetBeans IDE 7.x
Windows 8 Hot or Not
Evolution of .net frame work
A walkthrough of JavaScript ES6 features
Lets Auto It
Ionic 2 - Introduction
A Developer's View of Windows 8
From .NET Core 3, all the rest will be legacy
What's New in NetBeans IDE 7.x

What's hot (18)

PDF
Begining Android Development
PDF
Targeting Android with Qt
PDF
Testing cloud and kubernetes applications - ElasTest
PPTX
TypeScript Introduction
PPTX
.NET Core: a new .NET Platform
PDF
Professional JavaScript Development (An Introduction for Java Developers)
PPTX
Microfrontends Monoreops & Trunkbased based
PDF
Customize UI with Protocols
PPTX
Confessions of a java developer that fell in love with the groovy language
PPTX
PPT
Dot Net Introduction
PDF
C# On The iPhone with MonoTouch at DDD8
PPT
Portable Class Library Deep Dive
PDF
Java & JavaScript: Best Friends?
PDF
Kann JavaScript elegant sein?
PDF
How to modernise WPF and Windows Forms applications with Windows Apps SDK
PPT
Netbeans IDE & Platform
PPTX
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
Begining Android Development
Targeting Android with Qt
Testing cloud and kubernetes applications - ElasTest
TypeScript Introduction
.NET Core: a new .NET Platform
Professional JavaScript Development (An Introduction for Java Developers)
Microfrontends Monoreops & Trunkbased based
Customize UI with Protocols
Confessions of a java developer that fell in love with the groovy language
Dot Net Introduction
C# On The iPhone with MonoTouch at DDD8
Portable Class Library Deep Dive
Java & JavaScript: Best Friends?
Kann JavaScript elegant sein?
How to modernise WPF and Windows Forms applications with Windows Apps SDK
Netbeans IDE & Platform
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
Ad

Similar to Radu vunvulea building and testing windows 8 metro style applications using c++,c# and java script (20)

PPTX
Win rt fundamentals
PPTX
Windows 8 & JavaScript
PDF
Windows 8 Development Stack
PPTX
Windows 8 for .NET Developers
PDF
Marlabs - MarlaBuzz November
PPTX
Introduction to Windows 8 Development
PPTX
Eco system apps
PPTX
Deep Dive into WinRT
PDF
Mobiiliaamiainen 8.11.2012: Petri Niemi, Windows (Phone) 8 and html5
PPTX
Introduction to Metro Applications
PPTX
Runtime 8 and Windows Phone 8
PPTX
Creating Windows Runtime Components
PPTX
PPTX
SLUGUK BUILD Round-up
DOC
A developer's first impressions for windows 8
PPTX
Welcome to windows 8
PPTX
Windows 8 mobile app development
PPTX
Windows 8
PPTX
Winrt for developers
PPTX
Windows phone 8 overview
Win rt fundamentals
Windows 8 & JavaScript
Windows 8 Development Stack
Windows 8 for .NET Developers
Marlabs - MarlaBuzz November
Introduction to Windows 8 Development
Eco system apps
Deep Dive into WinRT
Mobiiliaamiainen 8.11.2012: Petri Niemi, Windows (Phone) 8 and html5
Introduction to Metro Applications
Runtime 8 and Windows Phone 8
Creating Windows Runtime Components
SLUGUK BUILD Round-up
A developer's first impressions for windows 8
Welcome to windows 8
Windows 8 mobile app development
Windows 8
Winrt for developers
Windows phone 8 overview
Ad

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
A Presentation on Artificial Intelligence
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PDF
KodekX | Application Modernization Development
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Electronic commerce courselecture one. Pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
A Presentation on Artificial Intelligence
Understanding_Digital_Forensics_Presentation.pptx
MYSQL Presentation for SQL database connectivity
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
KodekX | Application Modernization Development
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Weekly Chronicles - August'25 Week I
Dropbox Q2 2025 Financial Results & Investor Presentation
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
NewMind AI Monthly Chronicles - July 2025
Per capita expenditure prediction using model stacking based on satellite ima...
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation theory and applications.pdf
Electronic commerce courselecture one. Pdf

Radu vunvulea building and testing windows 8 metro style applications using c++,c# and java script

  • 1. Building and testing Windows 8 Metro Style Applications using C++,C# and JavaScript Radu Vunvulea vunvulear@gmail.com http://vunvulearadu.blogspot.com
  • 2. Who am I? { “name” : “Radu Vunvulea, “company” : “iQuest”, “userType” : “enthusiastic” “technologies” : [ “.NET”, “JS”, “Azure”, “Web”, “Mobile”, “SL” ], “w8experience” : [ “2 LoB App”, “1 Travel App”], “blog” : “vunvulearadu.blogspot.com”, “email” : ”vunvulear@gmail.com”, “socialMedia” : { “twitter” : “@RaduVunvulea”, “fb” : “radu.vunvulea” } }
  • 3. Agenda • WinRT • Windows 8 Architecture I • WinMD • Windows 8 Architecture II • Windows 8 Profiles • Mixing Components • Extensibilities points • Unit tests • Windows 8 App Package
  • 4. •WinRT • WinMD • Chakra • Windows Kernel Service • Windows Runtime API • CLR, CRT, WinJS
  • 5. •WinRT • WinMD • Chakra • Windows Kernel Service • Windows Runtime API • CLR, CRT, WinJS
  • 6. What exactly is WinRT • WinRT – Windows Runtime • Allow us to build app that use Windows functionalities • We can use any kind of language (managed or not) • C# • C++ • JavaScript • Visual Basic • Language projection for any kind of language • Expose Windows functionalities • Native for any supported language
  • 7. What exactly is WinRT • WinRT – Windows Runtime • Allow us to build app that use Windows functionalities • We can use any kind of language (managed or not) • C# • C++ • JavaScript • Visual Basic • Language projection for any kind of language • Expose Windows functionalities • Native for any supported language
  • 8. Why WinRT is good • We don’t need to use COM and Win32 anymore – for “Metro Apps” • Easy access to Windows features • Object lifetime management • Same API on different languages • A lot of things are supported by default, we don’t need to write code for that: • Image capture • IO access • Geolocation • Contracts • Networking • … and so on
  • 9. Why WinRT is good • We don’t need to use COM anymore • Easy access to Windows features • Object lifetime management • Same API on different languages • A lot of things are supported by default, we don’t need to write code for that: • Image capture • IO access • Geolocation • Contracts • Networking • … and so on
  • 10. What about WinMD • WinMD – Windows Metadata • Describe what a WinRT component can do • Separate file, not included in the WinRT file • Compatible metadata - .NET ECMA-355 (not IDL) • This is the secret which make it possible a WinRT object to be consumed by - native C++ - managed C# - JavaScript using Chakra JS Engine
  • 11. Windows 8 and WinRT architecture
  • 12. Windows 8 and WinRT Architecture
  • 13. Windows 8 and WinRT Architecture • Only one CLR for all application (desktop and “Metro Apps”) • Different instances for desktop and “Metro Apps” • Only one IL for all applications (desktop and “Metro Apps”) • Only one MSIL for all applications • The same .NET Framework 4.5 is used for all applications, but it used different profiles • .NET Client Profile – desktop • .NET Metro Profile – “Metro Apps” • Framework contains rules that define what parts are available for each profile
  • 14. Windows 8 Profiles .NET Silverlight .NET Windows Phone Windows 8 Apps
  • 15. What should I use? • JavaScript with HTML 5 and CSS + Well Known + IndexdDB + Dynamic language - WinRT not fully available • C# with XAML + Full access to WinRT + some custom libraries + async/await, async calls supported at language level + Component written for SL or WP7 can be reused + Well known - XAML can be a hell sometimes • C++ + Very fast + DirectX (games)
  • 16. How to mix different components C# C++ Java Script
  • 17. How to mix different components C# C++ It is not possible Java Script
  • 18. How to mix different components • .WinMD describes all the public API exposed by the component • For JavaScript, the system will manage the class instances • We don’t need to configure the project that will generate the shared component • Be aware that you cannot have/use • XAML controllers in a Java Script app • Java Script components in a XAML/C# project • Even if we have a WebView, we don’t have full access • We can have a C# component that use XAML and use it in a C++ application that use DirectX
  • 19. How to create reusable C# components • Our class that will be exposed have to: • Be sealed • Be public • No virtual • The class should not be empty • The class should not be abstract • All the input and output of collection types need to be interfaces (IList) • Interfaces are not supported in this moment to be exposed • Windows.Foundation.Metadata.DefaultOverload– for overloading
  • 20. How to create reusable C# components • Asynchronous calls are supported • An asynchronous call need to return an IAsyncOperationTReturn> • We can obtain it calling “AsAsyncOperation()” method. • A Task<T> is automatically converted into Promise • Don’t forget to named your method accordingly • Any method that’s take longer than 50ms
  • 21. Demo
  • 22. What about extensibility… • It is an important feature for LoB applications • Dynamic components loading (reflection) • JS loaded and compiled at runtime • MEF (Managed Extensibility Framework) • Prims
  • 23. What about extensibility… • It is an important feature for LoB applications • Dynamic components loading (reflection) • JS loaded and compiled at runtime • MEF (Managed Extensibility Framework) • Prims • Non-official response • Wait, have patience, in 6-9 months we may have something for you
  • 24. Demo
  • 25. Unit tests • For code written in C/C++, C# and Visual Basic we have build in support for unit tests
  • 26. Unit tests • For code written in C/C++, C# and Visual Basic we have build in support for unit tests • What about Java Script? • Should we write unit tests for it? • Can I run unit tests from Visual Studio 2012? • Can I integrate Java Script unit tests to the build machine?
  • 27. Unit tests • For code written in C/C++, C# and Visual Basic we have build in support for unit tests • What about Java Script? • Should we write unit tests for it? YES • Can I run unit tests from Visual Studio 2012? YES • Can I integrate Java Script unit tests to the build machine? YES • There are a lot of frameworks and plugins for this: • Chutzpah Test Adapter for Visual Studio 2012 • QUnit
  • 28. Demo
  • 29. Windows 8 App Package • A package contains all the files that are required by our application to run • An update of our app represent a new version of package that contains all the files (not the delta) • Each package is sign by the author using a unique key • A package can be created using • Visual Studio • MakeAppX.exe (command line)
  • 30. Windows 8 App Package • Every package contains a Package Manifest • Package Manifest: • Package identity (package name, version, publisher, processor architecture, resource ID) • Package properties information about package • Capabilities a list of application capabilities • Extensions used to communicate with system and other application • Visual elements default tile, logo images, background color, and splash screen
  • 31. Windows 8 App Package • Each package contains a Power Shell script • A normal user can install a package only from Marketplace • Using a developer account any package can be installed on a computer (even the packages that are not signed) • Corporate devices – Windows 8 Enterprise • Windows 8 App packages that can be pushed from the corporate network without the need to publish the application on the Marketplace.
  • 32. Demo
  • 34. THE END Radu Vunvulea vunvulear@gmail.com http://vunvulearadu.blogspot.com

Editor's Notes