Leveraging existing code in Metro style apps 5/9/2019 10:19 AM PLAT-877T Leveraging existing code in Metro style apps Jason Olson Program Manager Microsoft Corporation @jolson88 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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.
Do less work to get more done!
Agenda Using the breadth of existing code that exists today Let the platform do the work for you where possible You can use code that others have written You can use your own code Some tips ‘n tricks you should know about reusing existing code You’ll leave with… Examples of reusing existing C#/C++/JS code Most important things you need to know when reusing existing code Pointers to more content
Three types of code reuse Platform Features Other People’s Code Your Own Code
The best code is code you never write in the first place… Platform Features The best code is code you never write in the first place…
Using Windows contracts 5/9/2019 10:19 AM demo Using Windows contracts © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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.
Let the platform do the work for you when possible.
Content for more depth [405] Share: Your app powers the Windows 8 share experience [406] Search: Integrating into the Windows 8 search experience SDK Sample: Search Contract Sample SDK Sample: Shared Source Sample SDK Sample: Camera Capture UI Sample SDK Sample: PlayTo Sample
Why write it yourself when someone else has written it for you? Other People’s Code Why write it yourself when someone else has written it for you?
jQuery jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.
Groove – Building a drum sequencer UI 5/9/2019 10:19 AM demo Groove – Building a drum sequencer UI © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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.
Content for more depth [381] Building beautiful and interactive apps with HTML5 & CSS3 [382] What’s new with HTML5, Javascript, and CSS3 [873] Designing Metro style apps using CSS3
There’s always a counter-example… Other People’s Code There’s always a counter-example…
demo Using NodaTime 5/9/2019 10:19 AM © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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.
Windows SDK enables a simplified development experience.
Compiling NodaTime for Windows 8 5/9/2019 10:19 AM demo Compiling NodaTime for Windows 8 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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.
You can use code that others have written.
Content for more depth [531] Using the Windows Runtime from C# and Visual Basic [532] Using the Windows Runtime from C++ [Lab] – Using C++ to enhance your Metro style apps built using Javascript [Lab] – Using the Windows App Certification Kit to validate and prepare Metro style apps for the Store
Reusing your own code and exposing it via the Windows Runtime
Two ways to expose… OR WinRT Component WinRT Components WinRT Language Projection Language Projection WinRT Components WinRT Component WinRT Components OR Native or .NET Components Native or .NET Components
Groove – Playing dynamic audio demo Groove – Playing dynamic audio © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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.
You can use your own code and expose it via the Windows Runtime.
Be mindful of the amount of communication across language Boundaries.
Sessions for more depth [PLAT-874T] Lap around the Windows Runtime [PLAT-875T] Windows Runtime internals: understanding "Hello World" [TOOL-531T] Using the Windows Runtime from C# and Visual Basic [TOOL-532T] Using the Windows Runtime from C++ Dev Center: The Windows Runtime Dev Center: C++ Language Extension Summary
Three types of code reuse Platform Features Other People’s Code Your Own Code
Key takeaways Let the platform do the work for you You can use code that others have already written You can use your own code and expose it via the Windows Runtime if necessary Use the right tool for the right job
Do less work to get more done!
thank you Feedback and questions http://forums.dev.windows.com Session feedback http://bldw.in/SessionFeedback
5/9/2019 10:19 AM © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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.