Mspress Books Developer

Total Page:16

File Type:pdf, Size:1020Kb

Mspress Books Developer PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2014 Microsoft Corporation All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Microsoft Press books are available through booksellers and distributors worldwide. If you need support related to this book, email Microsoft Press Book Support at [email protected]. Please tell us what you think of this book at http://aka.ms/tellpress. Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in examples herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft and the trademarks listed at http://www.microsoft.com/about/legal/en/us/IntellectualProperty/ Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property of their respective owners. This book expresses the author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Acquisitions, Developmental, and Project Editor: Devon Musgrave Cover: Twist Creative • Seattle and Joel Panchot 1 Table of Contents Introduction ........................................................................................................................ 21 Who This Book Is For ........................................................................................................ 23 What You'll Need (Can You Say “Samples”?) ...................................................................... 24 A Formatting Note............................................................................................................ 25 Acknowledgements .......................................................................................................... 26 Free Ebooks from Microsoft Press ..................................................................................... 28 The “Microsoft Press Guided Tours” App ........................................................................... 28 Errata & Book Support ...................................................................................................... 28 We Want to Hear from You............................................................................................... 29 Stay in Touch ................................................................................................................... 29 Chapter 1 The Life Story of a Windows Store App: Characteristics of the Windows Platform .............................................................................................................. 30 Leaving Home: Onboarding to the Windows Store ............................................................. 32 Discovery, Acquisition, and Installation.............................................................................. 35 Playing in Your Own Room: The App Container .................................................................. 39 Different Views of Life: Views and Resolution Scaling ......................................................... 42 Those Capabilities Again: Getting to Data and Devices ........................................................ 46 Taking a Break, Getting Some Rest: Process Lifecycle Management..................................... 49 Remembering Yourself: App State and Roaming................................................................. 51 Coming Back Home: Updates and New Opportunities ........................................................ 56 And, Oh Yes, Then There’s Design ..................................................................................... 58 Feature Roadmap and Cross-Reference ............................................................................. 59 Chapter 2 Quickstart .......................................................................................................... 65 A Really Quick Quickstart: The Blank App Template ............................................................ 65 Blank App Project Structure .......................................................................................... 68 2 QuickStart #1: Here My Am! and an Introduction to Blend for Visual Studio ........................ 72 Design Wireframes ....................................................................................................... 73 Create the Markup ....................................................................................................... 76 Styling in Blend............................................................................................................. 78 Adding the Code........................................................................................................... 83 Extra Credit: Improving the App ........................................................................................ 97 Receiving Messages from the iframe ............................................................................. 98 Improving the Placeholder Image with a Canvas Element................................................ 99 Handling Variable Image Sizes ..................................................................................... 100 Moving the Captured Image to AppData (or the Pictures Library) .................................. 103 Using a Thumbnail Instead of the Full Image ................................................................ 105 The Other Templates: Projects and Items ........................................................................ 107 Navigation App Template............................................................................................ 107 Grid App Template ..................................................................................................... 107 Hub App Template...................................................................................................... 108 Split Template ............................................................................................................ 108 Item Templates .......................................................................................................... 108 What We’ve Just Learned ............................................................................................... 109 Chapter 3 App Anatomy and Performance Fundamentals .................................................. 111 App Activation ............................................................................................................... 112 Branding Your App 101: The Splash Screen and Other Visuals ....................................... 113 Activation Event Sequence .......................................................................................... 117 Activation Code Paths ................................................................................................. 119 WinJS.Application Events ............................................................................................ 121 Optimizing Startup Time ............................................................................................. 124 WinRT Events and removeEventListener.......................................................................... 126 App Lifecycle Transition Events and Session State ............................................................ 128 Suspend, Resume, and Terminate................................................................................ 129 3 Basic Session State in Here My Am! ............................................................................. 133 Page Controls and Navigation ......................................................................................... 136 WinJS Tools for Pages and Page Navigation .................................................................. 136 The Navigation App Template, PageControl Structure, and PageControlNavigator ......... 139 The Navigation Process and Navigation Styles .............................................................. 146 Optimizing Page Switching: Show-and-Hide ................................................................. 148 Page-Specific Styling ................................................................................................... 149 Async Operations: Be True to Your Promises .................................................................... 151 Using Promises ........................................................................................................... 151 Joining Parallel Promises ............................................................................................. 153 Sequential Promises: Nesting and Chaining .................................................................
Recommended publications
  • 「Citizenship Report 2014
    Citizenship Report 2014 - 2015 Creating a real impact for a better tomorrow, with the power of ICT and the mind of citizenship The future is ahead of us and Japan is moving toward it with strong footsteps. With Tokyo being selected to host the Olympics in 2020, the Japanese society sees the lights breaking through the clouds, starting to illuminate the future. Japan is still facing a number of pressing challenges, such as the trend toward becoming a highly aged society, a shrinking working age population, declining job opportunities, and contracting regional economies. In addressing these social issues, information and communications technology or ICT, has an indispensable role to play, as specifically noted in the Japanese government’s “Declaration to be the World’s Most Advanced IT Nation”. As a leading company of ICT, Microsoft Japan is contributing to finding solutions to these challenges and driving new societal movements especially in the areas of “cloud” and “mobile” technologies. Microsoft’s new mission is to “empower all individuals and organizations on the planet to achieve more.” By connecting ICT with people, ICT with Japan, and ICT with the future, we are determined to serve various communities. We believe this is the natural role of Microsoft Japan—a company that has taken root in Japan and has been growing together with Japanese society. 2 Citizenship Report 2014-2015 Contents 4 Leadership Dialogue What actions are local governments and businesses expected to take to enhance the vibrancy of local communities? —Toward progress in the “regional vitalization” initiative 8 Local Revitalization 10 Work Style New Directions 13 Small Businesses and Startups 14 Education Becoming a “productivity and platform” company 18 Information Security In February 2014, Satya Nadella was appointed as the 20 Contribution to Local Society third CEO of Microsoft Corporation.
    [Show full text]
  • Create Mobile Apps with HTML5, Javascript and Visual Studio
    Create mobile apps with HTML5, JavaScript and Visual Studio DevExtreme Mobile is a single page application (SPA) framework for your next Windows Phone, iOS and Android application, ready for online publication or packaged as a store-ready native app using Apache Cordova (PhoneGap). With DevExtreme, you can target today’s most popular mobile devices with a single codebase and create interactive solutions that will amaze. Get started today… ・ Leverage your existing Visual Studio expertise. ・ Build a real app, not just a web page. ・ Deliver a native UI and experience on all supported devices. ・ Use over 30 built-in touch optimized widgets. Learn more and download your free trial devexpress.com/mobile All trademarks or registered trademarks are property of their respective owners. Untitled-4 1 10/2/13 11:58 AM APPLICATIONS & DEVELOPMENT SPECIAL GOVERNMENT ISSUE INSIDE Choose a Cloud Network for Government-Compliant magazine Applications Geo-Visualization of SPECIAL GOVERNMENT ISSUE & DEVELOPMENT SPECIAL GOVERNMENT ISSUE APPLICATIONS Government Data Sources Harness Open Data with CKAN, OData and Windows Azure Engage Communities with Open311 THE DIGITAL GOVERNMENT ISSUE Inside the tools, technologies and APIs that are changing the way government interacts with citizens. PLUS SPECIAL GOVERNMENT ISSUE APPLICATIONS & DEVELOPMENT SPECIAL GOVERNMENT ISSUE & DEVELOPMENT SPECIAL GOVERNMENT ISSUE APPLICATIONS Enhance Services with Windows Phone 8 Wallet and NFC Leverage Web Assets as Data Sources for Apps APPLICATIONS & DEVELOPMENT SPECIAL GOVERNMENT ISSUE ISSUE GOVERNMENT SPECIAL DEVELOPMENT & APPLICATIONS Untitled-1 1 10/4/13 11:40 AM CONTENTS OCTOBER 2013/SPECIAL GOVERNMENT ISSUE OCTOBER 2013/SPECIAL GOVERNMENT ISSUE magazine FEATURES MOHAMMAD AL-SABT Editorial Director/[email protected] Geo-Visualization of Government KENT SHARKEY Site Manager Data Sources MICHAEL DESMOND Editor in Chief/[email protected] Malcolm Hyson ..........................................
    [Show full text]
  • Exam Ref 70-482: Advanced Windows Store App Development Using HTML5 and Javascript
    Exam Ref 70-482: Advanced Windows Store App Development Using HTML5 and JavaScript Roberto Brunetti Vanni Boncinelli Copyright © 2013 by Roberto Brunetti and Vanni Boncinelli All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. ISBN: 978-0-7356-7680-0 1 2 3 4 5 6 7 8 9 QG 8 7 6 5 4 3 Printed and bound in the United States of America. Microsoft Press books are available through booksellers and distributors worldwide. If you need support related to this book, email Microsoft Press Book Support at [email protected]. Please tell us what you think of this book at http://www.microsoft.com/learning/booksurvey. Microsoft and the trademarks listed at http://www.microsoft.com/about/legal/ en/us/IntellectualProperty/Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property of their respec- tive owners. The example companies, organizations, products, domain names, email ad- dresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. This book expresses the author’s views and opinions. The information con- tained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book.
    [Show full text]
  • Multilingual Extractive Reading Comprehension by Runtime Machine Translation
    Multilingual Extractive Reading Comprehension by Runtime Machine Translation Akari Asaiy, Akiko Eriguchiy, Kazuma Hashimotoz, and Yoshimasa Tsuruokay yThe University of Tokyo zSalesforce Research [email protected] zferiguchi,[email protected] [email protected] Abstract to English. To alleviate the scarcity of training data in non- Despite recent work in Reading Comprehen- English languages, previous work creates a new sion (RC), progress has been mostly limited to English due to the lack of large-scale datasets large-scale dataset for a language of interest (He in other languages. In this work, we introduce et al., 2017) or combines a medium-scale dataset the first RC system for languages without RC in the language with an existing dataset translated training data. Given a target language without from English (Lee et al., 2018). These efforts in RC training data and a pivot language with RC data creation are often costly, and must be repeated training data (e.g. English), our method lever- for each new language of interest. In addition, they ages existing RC resources in the pivot lan- do not leverage existing resources in English RC, guage by combining a competitive RC model such as the wealth of large-scale datasets and state- in the pivot language with an attentive Neural Machine Translation (NMT) model. We first of-the-art models. translate the data from the target to the pivot In this paper, we propose a multilingual extrac- language, and then obtain an answer using the tive RC method by runtime Machine Translation RC model in the pivot language.
    [Show full text]
  • 1.1.2 MIT Backbonejs.Org File Bootstrap Apache
    Resource name License License reference Usage Type backbone-1.1.2 MIT backbonejs.org File bootstrap Apache 2.0 http://getbootstrap.com/javascript/ File bootstrap-datetimepicker-v2.0.1 Apache 2.0 https://github.com/Eonasdan/bootstrap-datetimepicker/blob/v2.0.1/LICENSE File cache.js MIT https://github.com/monsur/jscache FIle Common.Logging.Core.dll Apache 2.0 http://netcommon.sourceforge.net/license.html Dynamic Library Common.Logging.dll Apache 2.0 http://netcommon.sourceforge.net/license.html Dynamic Library DocumentFormat.OpenXml.dll Apache 2.0 https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE.txt Dynamic Library enquire.js MIT http://wicky.nillia.ms/enquire.js File globalize MIT http://github.com/jquery/globalize File handlebars MIT https://github.com/wycats/handlebars.js/blob/master/LICENSE File HTML5 Sortable MIT License http://farhadi.ir/projects/html5sortable/ File hu.js MIT https://github.com/Canop/hu.js File ICSharpCode.SharpZipLib.dll GPL with exceptions http://icsharpcode.github.io/SharpZipLib/ Dynamic Library icudt34.dll ICU License http://www-306.ibm.com/software/globalization/icu/index.jsp Dynamic Library icuin34.dll ICU License http://www-306.ibm.com/software/globalization/icu/index.jsp Dynamic Library icuuc34.dll ICU License http://www-306.ibm.com/software/globalization/icu/index.jsp Dynamic Library indexedDBshim MIT https://github.com/axemclion/IndexedDBShim File interact.js MIT https://raw.github.com/taye/interact.js/master/LICENSE File interact.js MIT https://raw.githubusercontent.com/taye/interact.js/master/LICENSE
    [Show full text]
  • Microsoft 2012 Citizenship Report
    Citizenship at Microsoft Our Company Serving Communities Working Responsibly About this Report Microsoft 2012 Citizenship Report Microsoft 2012 Citizenship Report 01 Contents Citizenship at Microsoft Serving Communities Working Responsibly About this Report 3 Serving communities 14 Creating opportunities for youth 46 Our people 85 Reporting year 4 Working responsibly 15 Empowering youth through 47 Compensation and benefits 85 Scope 4 Citizenship governance education and technology 48 Diversity and inclusion 85 Additional reporting 5 Setting priorities and 16 Inspiring young imaginations 50 Training and development 85 Feedback stakeholder engagement 18 Realizing potential with new skills 51 Health and safety 86 United Nations Global Compact 5 External frameworks 20 Supporting youth-focused 53 Environment 6 FY12 highlights and achievements nonprofits 54 Impact of our operations 23 Empowering nonprofits 58 Technology for the environment 24 Donating software to nonprofits Our Company worldwide 61 Human rights 26 Providing hardware to more people 62 Affirming our commitment 28 Sharing knowledge to build capacity 64 Privacy and data security 8 Our business 28 Solutions in action 65 Online safety 8 Where we are 67 Freedom of expression 8 Engaging our customers 31 Employee giving and partners 32 Helping employees make 69 Responsible sourcing 10 Our products a difference 71 Hardware production 11 Investing in innovation 73 Conflict minerals 36 Humanitarian response 74 Expanding our efforts 37 Providing assistance in times of need 76 Governance 40 Accessibility 77 Corporate governance 41 Empowering people with disabilities 79 Maintaining strong practices and performance 42 Engaging students with special needs 80 Public policy engagement 44 Improving seniors’ well-being 83 Compliance Cover: Participants at the 2012 Imagine Cup, Sydney, Australia.
    [Show full text]
  • New Visual Studio 2013 Diagnostic Tools
    New Visual Studio 2013 Diagnostic Tools --- Overview In this lab, you will learn about some of the new diagnostic tools that were introduced with Visual Studio 2012 updates, as well as the new diagnostic tools introduced in Visual Studio 2013. You will also be introduced to the enhanced asynchronous debugging features found in Visual Studio 2013. Objectives In this hands-on lab, you will learn how to do the following: - Use the Performance and Diagnostics Hub - Use the UI Responsiveness Tools for JavaScript and XAML Windows Store applications - Use the Energy Consumption Tool - Analyze JavaScript Memory Usage - Create and Analyze Managed Memory Dumps - Use the enhanced asynchronous debugging features in Visual Studio 2013 Prerequisites The following are required to complete this hands-on lab: - Windows 8.1 - Microsoft Visual Studio 2013 (with Update 2 RC applied) Notes Estimated time to complete this lab: 60 minutes. Note: You can log into the virtual machine with user name “User” and password “P2ssw0rd”. Note: This lab may make references to code and other assets that are needed to complete the exercises. You can find these assets on the desktop in a folder named TechEd 2014. Within that folder, you will find additional folders that match the name of the lab you are working on. Exercise 1: Introduction to Performance and Diagnostics Hub In this exercise, you will you will learn about the new Performance and Diagnostics Hub in Visual Studio 2013. The new hub brings together existing tools into one location, and makes it easier to see what tools are available for the current project based on the current language, application type, or platform.
    [Show full text]
  • Open Source Components
    Open Source Components Resource Name License License Reference Usage Type ace.js BSD https://github.com/ajaxorg/ace/blob/master/LICENSE backbone-1.1.2 MIT backbonejs.org File bootstrap Apache 2.0 http://getbootstrap.com/javascript/ File bootstrap-datetimepicker-v2.0.1 Apache 2.0 https://github.com/Eonasdan/bootstrap-datetimepicker/blob/v2.0.1/LICENSE File cache.js MIT https://github.com/monsur/jscache FIle Common.Logging.Core.dll Apache 2.0 http://netcommon.sourceforge.net/license.html Dynamic Library Common.Logging.dll Apache 2.0 http://netcommon.sourceforge.net/license.html Dynamic Library DeployR Apache 2.0 https://deployr.revolutionanalytics.com/license/ DrillDown.js MIT http://code.highcharts.com/modules/drilldown.js File DocumentFormat.OpenXml.dll Apache 2.0 https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE.txt Dynamic Library enquire.js MIT http://wicky.nillia.ms/enquire.js File globalize MIT http://github.com/jquery/globalize File handlebars MIT https://github.com/wycats/handlebars.js/blob/master/LICENSE File HTML5 Sortable MIT License http://farhadi.ir/projects/html5sortable/ File hu.js MIT https://github.com/Canop/hu.js File ICSharpCode.SharpZipLib.dll GPL with exceptions http://icsharpcode.github.io/SharpZipLib/ Dynamic Library icudt34.dll ICU License http://www-306.ibm.com/software/globalization/icu/index.jsp Dynamic Library icuin34.dll ICU License http://www-306.ibm.com/software/globalization/icu/index.jsp Dynamic Library icuuc34.dll ICU License http://www-306.ibm.com/software/globalization/icu/index.jsp Dynamic
    [Show full text]
  • NET Technology Guide for Business Applications // 1
    .NET Technology Guide for Business Applications Professional Cesar de la Torre David Carmona Visit us today at microsoftpressstore.com • Hundreds of titles available – Books, eBooks, and online resources from industry experts • Free U.S. shipping • eBooks in multiple formats – Read on your computer, tablet, mobile device, or e-reader • Print & eBook Best Value Packs • eBook Deal of the Week – Save up to 60% on featured titles • Newsletter and special offers – Be the first to hear about new releases, specials, and more • Register your book – Get additional benefits Hear about it first. Get the latest news from Microsoft Press sent to your inbox. • New and upcoming books • Special offers • Free eBooks • How-to articles Sign up today at MicrosoftPressStore.com/Newsletters Wait, there’s more... Find more great content and resources in the Microsoft Press Guided Tours app. The Microsoft Press Guided Tours app provides insightful tours by Microsoft Press authors of new and evolving Microsoft technologies. • Share text, code, illustrations, videos, and links with peers and friends • Create and manage highlights and notes • View resources and download code samples • Tag resources as favorites or to read later • Watch explanatory videos • Copy complete code listings and scripts Download from Windows Store Free ebooks From technical overviews to drilldowns on special topics, get free ebooks from Microsoft Press at: www.microsoftvirtualacademy.com/ebooks Download your free ebooks in PDF, EPUB, and/or Mobi for Kindle formats. Look for other great resources at Microsoft Virtual Academy, where you can learn new skills and help advance your career with free Microsoft training delivered by experts.
    [Show full text]
  • Microsoft 2006 Citizenship Report
    partners in innovation 2006 CITIZENSHIP REPO R T about this report ScOPE CUrrENCY In the 2006 Microsoft Global Citizenship Report, All money figures in this report are in we discuss our key citizenship initiatives and U.S. dollars unless otherwise noted. activities worldwide, highlight some of our more significant accomplishments in fiscal year TERMINOLOGY 2006, and share our goals for fiscal year 2007. The terms “Global Citizenship” and “Corporate Citizenship,” which are used throughout REPORTING PERIOD this report, are interchangeable with This report focuses on Microsoft’s fiscal similar terms such as “Corporate Social year 2006 (which began July 1, 2005, Responsibility” and “Corporate Sustainability.” and ended June 30, 2006). All data is for that period unless otherwise noted. GLOBAL REPORTING INITIATIVE (GRI) The function of the GRI performance REPORT STRUCTURE indicators is to make it easier to compare This report is organized to reflect the organizational reports on the basis of economic, structure of our Global Citizenship Initiative environmental, and social impacts. In the and related activities, because we want our online portion of this report, we have included stakeholders — employees, customers, partners, references to applicable GRI indicators to assist shareholders, and others—to be able to stakeholders in their review and assessment compare our program goals and objectives of our Global Citizenship Initiative. with our results. The report is a combination of this print volume, which highlights and More information provides an overview of some key issues, and about the GRI performance indicators is a more detailed online publication that we will available at www.globalreporting.org. update annually.
    [Show full text]
  • Murphy Why Did the Xbox Fail in Japan?
    Travis “L.D.” Murphy Why Did the Xbox Fail in Japan? The sixth console generation was an interesting time in the video game industry. Among other things, it marked the end of the bit wars, the rise of online gaming, and the fall of SEGA from the console market. But in SEGA’s place rose Microsoft with their own Xbox. While the behemoth of a console was unable to shake the PS2’s firm hold on the market, it still managed to edge out Nintendo’s GameCube with over 24 million units sold worldwide. [1] While this victory secured Microsoft’s place as a major player in the console gaming market in the west, the same couldn’t be said for Japan as, despite the company’s efforts, the Xbox barely managed to sell an estimated 450,000 units in the region throughout its lifespan. [2] In fact, on July 18th, 2004 it was reported that even the PlayStation 1, which had been out for almost a decade by that point, outsold the Xbox in Japan too. [3] It’s important to note that Microsoft faced an uphill battle from the very beginning. After all, Japanese companies had a very firm hold on the video game console market ever since the aftermath of the video game crash of 1983. Furthermore, Japan alone represented nearly a third of the market. [4]So, from the early days developing the system, the Xbox team kept Japan close in mind. Then Xbox Director of Third Party Relations, Kevin Bachus, recalled, “We were basically going to play in Sony, Sega and Nintendo's home stadium.
    [Show full text]
  • Security Intelligence Report
    Managing Risks Microsoft | Security Intelligence Report Volume 9 January through June 2010 Microsoft | Security Intelligence Report Microsoft Security Intelligence Report This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. This document is provided “as-is”. Information and views expressed in this document, including URL and other Internet website references, may change without notice. You bear the risk of using it. Copyright © 2010 Microsoft Corporation. All rights reserved. The names of actual companies and products mentioned herein may be the trademarks of their respective owners. 2 January through June 2010 Authors David Anselmi Jimmy Kuo Navaneethan Santhanam Digital Crimes Unit Microsoft Malware Protection Center Bing Richard Boscovich Scott Molenkamp Christian Seifert Digital Crimes Unit Microsoft Malware Protection Center Bing T.J. Campana Michelle Meyer Frank Simorjay Digital Crimes Unit Microsoft Trustworthy Computing Microsoft Trustworthy Computing Neil Carpenter Bala Neerumalla Holly Stewart CSS Security Microsoft Secure SQL Initiative Team Microsoft Malware Protection Center Greg Cottingham Daryl Pecelj Adrian Stone CSS Security Microsoft IT Information Security and Risk Management Microsoft Security Response Center Joe Faulhaber Anthony Penta Matt Thomlinson Microsoft Malware Protection Center Microsoft Windows Safety Platform Microsoft Security Response Center Vinny Gullotto Paul Pottorff Jossie Tirado Arroyo Microsoft Malware
    [Show full text]