Exam Ref 70-482: Advanced Windows Store App Development Using HTML5 and JavaScript
Roberto Brunetti
Vanni Boncinelli
Published by Microsoft Press
This book is dedicated to my parents.
R OBERRTO B RRUNETTI
This book is dedicated to my family.
R ANNI B ONCINELLI
Special Upgrade Offer
If you purchased this ebook directly from oreilly.com, you have the following benefits:
DRM-free ebooksuse your ebooks across devices without restrictions or limitations
Multiple formatsuse on your laptop, tablet, or phone
Lifetime access, with free updates
Dropbox syncingyour files, anywhere
If you purchased this ebook from another retailer, you can upgrade your ebook to take advantage of all these benefits for just $4.99. to access your ebook upgrade.
Please note that upgrade offers are not available from sample content.
Introduction
The Microsoft 70-482 certification exam tests your knowledge of Windows Store application development using HTML5 and JavaScript. Readers are assumed to be Windows Store app developers with deep knowledge of the Windows Runtime architecture, the application life cycle managed by the system (including suspend, termination, resume, and launch), the Visual Studio 2012 project structure, the application manifest, app deployment, and Windows Store requirements. The reader must have also a strong background in HTML5 and JavaScript.
This book covers every exam objective, but it does not cover every exam question. Only the Microsoft exam team has access to the exam questions themselves and Microsoft regularly adds new questions to the exam, making it impossible to cover specific questions. You should consider this book a supplement to your relevant real-world experience and other study materials. If you encounter a topic in this book that you do not feel completely comfortable with, use the links youll find in text to find more information and take the time to research and study the topic. Great information is available on MSDN, TechNet, and in blogs and forums.
Microsoft certifications
Microsoft certifications distinguish you by proving your command of a broad set of skills and experience with current Microsoft products and technologies. The exams and corresponding certifications are developed to validate your mastery of critical competencies as you design and develop, or implement and support, solutions with Microsoft products and technologies both on-premise and in the cloud. Certification brings a variety of benefits to the individual and to employers and organizations.
More Info: All Microsoft Certifications
For information about Microsoft certifications, including a full list of available certifications, go to http://www.microsoft.com/learning/en/us/certification/cert-default.aspx.
Acknowledgments
Id like to thank Vanni for his side-by-side work. He has shared with me all the intricacies of writing a book with this level of detail.
Roberto
Id like to thank Roberto, for teaching me everything I know today about software development, and Marika, for her support and infinite patience during the writing of this book.
Vanni
Roberto and Vanni want to thank all the people who made this book possible. In particular, we thank Kim Lindros, for her exceptional support throughout the editing process of this book; Jeff Riley, for giving us this opportunity; and Russell Jones, for introducing our team to Jeff.
Special thanks to Wouter de Kort for providing the content.
Errata & book support
Weve made every effort to ensure the accuracy of this book and its companion content. Any errors that have been reported since this book was published are listed on our Microsoft Press site at oreilly.com:
http://aka.ms/ER70-482/errata
If you find an error that is not already listed, you can report it to us through the same page.
If you need additional support, email Microsoft Press Book Support at .
Please note that product support for Microsoft software is not offered through the addresses above.
We want to hear from you
At Microsoft Press, your satisfaction is our top priority, and your feedback our most valuable asset. Please tell us what you think of this book at:
http://www.microsoft.com/learning/booksurvey
The survey is short, and we read every one of your comments and ideas. Thanks in advance for your input!
Stay in touch
Lets keep the conversation going! Were on Twitter: http://twitter.com/MicrosoftPress .
Preparing for the exam
Microsoft certification exams are a great way to build your resume and let the world know about your level of expertise. Certification exams validate your on-the-job experience and product knowledge. While there is no substitution for on-the-job experience, preparation through study and hands-on practice can help you prepare for the exam. We recommend that you round out your exam preparation plan by using a combination of available study materials and courses. For example, you might use this Exam Ref and another study guide for your at home preparation, and take a Microsoft Official Curriculum course for the classroom experience. Choose the combination that you think works best for you.
Note that this Exam Ref is based on publically available information about the exam and the authors experience. To safeguard the integrity of the exam, authors do not have access to the live exam.
Chapter 1. Develop Windows Store apps
In this chapter, you learn how to create background tasks, implement the appropriate interfaces, and consume tasks using timing and system triggers. You also find out how to request lock screen access and create download and upload operations using background transferring for Windows Store applications written in Hypertext Markup Language (HTML)/JavaScript (formerly called Windows Store apps using JavaScript). The last part of the chapter is dedicated to creating and consuming Windows Metadata (WinMD) components.
Important: Methods Capitalization
Throughout the code samples in this book, the syntax of the Windows Runtime (WinRT) library methods and events follow the traditional JavaScript syntax, while in the text, the same methods and events are initial capped. This is because the method definitions in the library are initial capped ( SetTrigger , for example), but thanks to the WinRT language projection feature, developers can use the syntax of their chosen language to invoke them ( setTrigger , for example). Language projection is discussed in , later in this chapter. Classes and namespaces are always initial capped.
Objectives in this chapter:
Objective 1.1: Create background tasks
Microsoft Windows 8 changes the way applications run. Windows Store application life-cycle management of the Windows Runtime is different from previous versions of Windows: only one application (or two in snapped view) can run in the foreground at a time. The system can suspend or terminate other applications from the Windows Runtime. This behavior forces the developer to use different techniques to implement some form of background workfor example, to download a file or perform tile updates.
This section covers how to implement a background task using the provided classes and interfaces, and how to code a simple task.
This objective covers how to: