Introduction

When I first saw JavaScript back in the mid-1990s, I would have never guessed that, in 2012, we would be writing PC applications using JavaScript. But here we are not only writing native applications using JavaScript and HTML, but also writing good-looking, well-performing applications.

JavaScript is a first-class language when it comes to building Windows Store apps. No longer are native Windows apps built only in C++ and .NET. But when writing Windows Store apps, we need to know more than JavaScript, HTML5, and CSS3. We need to understand the new Microsoft design language and the Microsoft design style principles to create Windows Store apps.

Fittingly, the beginning of the book lays a foundation to show how Windows is truly reimagined and how the paradigm has shifted drastically. The first part of the book examines each piece of the foundation before moving on to talk about the different types of hardware available in many Windows 8 devices. Many apps rely on working with data locally and remotely, and hours are devoted to those topics. Many hours discuss what is needed to truly make an app a Windows Store app, not just a website that runs on Windows. In addition, the book covers the different view states, such as snapped and portrait, and explains how to utilize contracts and extensions to truly integrate an app with Windows and even other apps.

By the end of this book, you will have created three complete apps, one of which is a game. Many demos teach concepts along the way. The final three hours of the book contain valuable information on how to pass certification, how to sell apps, and how to actually make money with apps.

Who Should Read This Book?

This book was written for developers who have a good understanding of programming in general. Readers are expected to understand JavaScript. Hour 1, “Getting a Refresher on JavaScript, HTML5, and CSS3,” covers some concepts that are vitally important to understand for the rest of the book, including JavaScript promises.

This book was written with a few audiences in mind. It is for the person who has dabbled in JavaScript and doesn’t mind spending some time in other resources to learn JavaScript and write Windows Store apps. It is for the web developer who wants to use an existing skill set and learn what more is needed to create Windows Store apps. It is also written for the C#/C++/Java/VB developer who has played with JavaScript and wants to learn how to make Windows Store apps while learning how JavaScript works through examples.

The book teaches by example. If you are not in front of your computer, you can still get valuable information from the book because the code is presented as discussed. However, being in front of the computer and actually working through each example is extremely valuable. Code is presented in logical segments as it was created, not in large listings. Although some listings are presented, rarely does the book list an entire code base; instead, it discusses segments of the code as it is being written. For the entire code, files should be downloaded from the book’s website. See the appendix for more information.

Hardware and Software Requirements

The code in this book compiles with Windows 8. To create Windows Store apps, Windows 8 must be installed. To complete the demos and apps in this book, the following requirements must be met:

Supported Operating Systems

Windows 8

Windows 8 Pro

Hardware Requirements

If the hardware can run the operating system, it will be able to run all apps in this book.

Software Requirements

All the software required to build Windows Store apps is free:

• Microsoft Visual Studio 2012 Express (Any VS2012 SKU works)

• Microsoft Blend for Visual Studio

Code Examples

Information on the source code for this book appears in the appendix.

Conventions Used in This Book

This book uses several design elements and conventions to help you prioritize and reference the information it contains.

In addition, this book uses various typefaces to help you distinguish code from regular English. Code is presented in a monospace font.


Note

Notes provide useful sidebar information that you can read immediately or circle back to without losing the flow of the topic at hand.



Caution

Cautions focus your attention on problems or side effects that can occur under certain situations.



Tip

Tips highlight information that can make your programming more effective.


How This Book Is Organized

This book is organized into seven main parts, representing the information you need to understand to create Windows Store apps effectively. Writing a book is an interesting challenge. An author can consider two potential routes: One is to create bite-size pieces that can be used as a reference. The other is to take the reader on a journey from start to finish, covering important topics along the way in such a manner that the reader is gradually learning concepts. Then after reading the entire book, the reader can go back and reread certain sections for mastery.

I opted for the second approach. The book is best read in chapter order. The Internet has a wealth of information, so learning about a particular topic is not difficult. The problem is, there is usually no place to see how many different topics work together. With a book that is designed to be read from front to back, the main drawback is a larger time commitment. However, it can give readers a deeper understanding of the topic by the time they complete the task. Certainly, both the Internet and printed resources are important, but because a wealth of reference information is available online, this book doesn’t need to be a reference book.

Part I, “Building the Foundation,” explains what the reader must understand to write Windows Store apps. Important topics that the reader is expected to know are presented in Hour 1. Each new project type available then is examined during Hour 2, “Trying Out File | New | Project.” Hour 3, “Exploring the Windows Runtime (WinRT) and Windows Library for JavaScript (WinJS),” and Hour 4, “Creating WinJS Namespaces, Classes, and Custom Controls,” look at the Windows API and how it can be accessed through JavaScript. Hour 5, “Understanding Microsoft Design Style Principles,” and Hour 6, “Customizing the Style of Our Apps,” discuss design principles and underscore why it is important for developers to be concerned with design and how to use a design tool like Blend to create compelling Windows Store apps. Hour 7, “Debugging, Securing, and Measuring Our App’s Performance,” looks at how to write apps that perform well. It discusses ways to debug Windows Store apps and details points to keep in mind to make sure that the apps are secure and none of the user’s information is being compromised.

Part II, “Handling the Hardware,” looks at the hardware available to Windows Store app developers. It discusses working with multitouch and using different sensors. GPS, Compass, Gyroscope, Mangometer, and Accelerometer are some of the sensors that are discussed.

Part III, “Working with Data,” works with data. Most apps need data to be compelling. This part of the book explains how developers can store data locally, as well as how to retrieve data from an external source. It also discusses how to display the data to the user by binding it to different controls, such as the popular ListView control.

Part IV, “Making It a Windows Store App,” takes the development process of Windows Store apps to the next level. This part of the book really explains what it means for an app to be a Windows Store app. It shows how apps can be integrated tightly within Windows so that users understand how the app functions, even though it has never been used. This part shows all the new features that make up Windows Store apps, including live tiles, pickers, contracts, and extensions, and explores the different views an app can be in.

Part V, “Putting It into Practice,” combines all the information in the rest of the book and creates three complete apps, one of which is a game. These apps show best practices for creating Windows Store apps.

Part VI, “Sending It Out to the World,” explains what it takes to actually submit the apps to the Windows Store and what is needed to pass certification. It also discusses ways a developer can make money by marketing the app and explores the different ways an app can be monetized. Part VII, “Appendix,” includes information about my website and how to obtain the source code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.168.46