Real World Windows 8 App Development with JavaScript Create Great Windows Store Apps - Edward Moemeka, Elizabeth Moemeka.pdf

(10023 KB) Pobierz
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
About the Authors�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½xiii
About the Technical Reviewer �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xv
Acknowledgments �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xvii
Introduction �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xix
■
Chapter 1: The Windows 8 Ethos and Environment �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½1
■
Chapter 2: Getting the Basics Right�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½35
■
Chapter 3: Incorporating Layout and Controls�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½59
■
Chapter 4: Navigating the Media Maze�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½123
■
Chapter 5: Making the Most Out of Charms and Contracts �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½147
■
Chapter 6: Solving the Printing Problem �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½175
■
Chapter 7: Providing Clear Notifications �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½189
■
Chapter 8: Keeping Apps Running in the Background�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½209
■
Chapter 9: Monetizing Your App: The Lowdown �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½223
■
Chapter 10: Getting Your App on the Windows Store �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½245
Index �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½267
v
Introduction
Welcome to
Real World App Development for Windows 8 with JavaScript.
From a technical side, this book provides a
step-by-step process for creating Windows 8 apps using JavaScript. From a functional side, this book seeks to inform
you about the guidelines, process, and interfaces specific to the Windows 8 OS. Through this book, we hope you’ll
learn everything you seek for creating as well as publishing your own Windows 8 apps.
Who This Book Is For
You’ve already picked up the book; so, like us, you’ve got a passion for cutting-edge technology. We didn’t choose to
write this book simply based on subject-matter knowledge. We’re excited about application development as well as
the newest Microsoft user interface, Windows 8—and we’re excited about the possibilities, expansion, and impact
inherent in both these technological movements.
We should clarify that this is not a beginner’s book. To grasp the knowledge and information in this book, you
should possess basic skills and a sound understanding of HTML and JavaScript. If you would like to put these skills to
work by learning how to program in Windows 8, then this book is for you. In the following chapters, we systematically
lay out the tools and tricks of the trade so you can forge ahead with your very own one-of-a-kind app concept and
turn it into something real, usable, and out there in the Windows Store—and, more to the point, on peoples’ devices,
integrated into their lives.
This book’s topic is something new and exciting in technology, and you get to be part of this expedition.
Microsoft is deeply integrated into the daily lives of millions of individuals and businesses. Windows 8 specifically
is Windows reimagined, liberated from the desktop analogy and rooted in the concept of interfacing in a dedicated
fashion with whatever the user may be doing. Because of this reimagined concept of Windows, there is a breadth of
new information to learn, and there are new ways of looking at the possibilities. In this book, we hope to expand and
enrich the opportunities for your own creative and professional endeavors.
What This Book Covers
As the title implies, we use JavaScript and HTML for the development of Windows 8 applications. We rely heavily on
samples and examples in this book. The purpose of this approach is to take you by the hand with concrete
showing-not-telling instruction.
This book doesn’t begin and end with the development of applications. Being a successful app developer goes
far beyond a good idea and the ability to develop and write code. This is why we spend significant time on the ins and
outs of what it takes to create a final product. We guide you through the process of getting your app into the Windows
Store, with instructions on topics such as claiming and naming your app, passing certification, making sure your app
meets the technological and appropriateness guidelines, and how to get set up to be a Microsoft vendor.
This book will work for you whether you read it through and learn incrementally, or use it as a reference volume.
With clearly laid out chapters and topics, you should feel comfortable turning to this book as a guide along the way as
you create your Windows 8 app.
We encourage you to explore the information in this book and to use it as a catalyst toward the success of your
own unique great app idea!
xix
Chapter 1
The Windows 8 Ethos and
Environment
Welcome to the brave new world of Windows 8. In this introductory chapter, you take a walk through the new,
drastically different UI. You grab a glimpse into the meaning of “Windows reimagined.” You begin the exploration
of what it means to a Windows app developer when you take away the iconic desktop concept and replace it with
full application integration. Technological and social impacts are considered as you, the developer, prep through
explanations, examples, and an examination of where the technology melds with the business of life.
Presently, Windows 8 is essentially the only OS out there that can run on anything from a phone all the way up to
a personal computer with the diverse reach of languages that are supported natively for Windows 8 development. This
book is about one such language—JavaScript—and how you, as a JavaScript developer, can use your knowledge of the
language (and of HTML and CSS as a UI layout engine) to build Windows 8 applications that feel to the user as real as
applications using .NET or even native C++.
A Not-So-Brief Introduction
To begin, allow us to shed some light on who we are so that you, dear reader, might understand the unique
perspective of this book. This is not a book by Microsoft fan-boys, but rather by commonsense, get-the-job-done
technology lovers. We also love an opportunity to make money while doing something cool, cutting edge, and
meaningful, so when we say that Windows 8 is the most significant opportunity for developers since … well, ever, take
notice. Although this might sound like regurgitated MS marketing spin, we’ve been on the front API lines, and we
boldly claim that everything in Windows 8
is
reimagined from the ground up, examined, and innovated upon.
Before diving in, it’s important to provide an introduction to Windows 8 from a developer’s perspective,
specifically focusing on how applications work and are managed by the system. The discussion isn’t exhaustive,
because the subject could probably span multiple books, but it should provide you with a baseline of information in
order to understand the basics of Windows 8 and Windows 8 app development using the Windows Runtime.
For the purpose of explanation, let’s walk through the Windows 8 UI artifacts—not because you don’t already
understand how Windows works, but for those of you who may not yet have access to the operating system.
The Windows 8 shell is a sort of digital reverse mullet: party time in the front, and good old-fashioned business
behind that. At a first glimpse of Windows 8, you’re immediately struck by the party component of the analogy: the
Windows 8 Start screen shown in Figure
1-1.
1
Zgłoś jeśli naruszono regulamin