Introduction

During its 27 years of life, Windows has undergone several big changes. Without a doubt, both users and developers perceive a big leap from Windows 7 to Windows 8! When Microsoft began development of the newest Windows version, it totally re-imagined the operating system. Instead of patching the previous versions and just adding new or mandatory features, Microsoft started developing Windows 8 from the ground up by defining the user experience as one of the top priorities.

The new operating system was previewed at the beginning of summer in 2011. At the Build developer’s conference held in Anaheim, California, in September 2011, Microsoft publicly released the Developer Preview version of Windows 8. Moreover, conference attendees were given an Intel-based quad-core Samsung tablet with Windows 8 Developer Preview installed. This event provided big momentum and built anticipation for the release of Microsoft’s newest operating system. Windows 8 was no longer just a concept. It was actually touchable — figuratively and physically.

Windows 8 introduces a new kind of application, referred to as Windows 8 style apps. These apps provide a novel approach for the users by means of a new user interface (UI)—such as the authentically digital user experience of the design, the fluent and responsive application screens, and the experience of browsing and installing apps from the Windows Store. These new apps not only provide a unique and pleasurable user experience, but developers can also take advantage of novel tools, APIs, and programming techniques!

Who This Book Is For

This book was created with the variety of programmers and software developers in mind. Although the tools and the programming languages for creating Windows 8 applications have matured and are used by millions of programmers all around the world, the majority of concepts and APIs are fairly new.

If you have experience with C++ programming or (in the realm of .NET) with C#/Visual Basic, or you have experience creating web pages with HTML and JavaScript, you’ll be able to use your existing skills and learn the new concepts and APIs. The chapters of this book are built on each other. If you read them from the beginning to the end, you’ll get to know the fundamentals of designing and creating Windows 8 style apps — even if you’re a novice programmer, or if you’ve just turned to Windows development.

The first part of the book prepares you for Windows 8 style app development. It provides an overview of the most important concepts and tools, and explains the architectural basics of the new development platform. If you’re a seasoned Windows programmer, you can skip Chapter 1 and Chapter 4.

The second part of the book starts by explaining the essential principles that are the key traits of modern app development, and these are used in the subsequent chapters.

The four programming languages that can be used for creating Windows 8 style apps are C++, C#, Visual Basic, and JavaScript. The size and scope of this book would have doubled if all four languages had been treated in detail, so C# is used in most of the samples and exercises. If you have web development experience, or you’re interested in programming apps with web technologies, Chapter 6 focuses on HTML5, CSS3, and JavaScript. If you’re using C++ today, Chapter 13 treats that great programming language in the context of Windows 8 apps.

What This Book Covers

Windows 8 promises that you can run every Windows 7 application on the new version of the operating system. Moreover, you can use existing technologies and tools to develop applications on Windows 8. This book focuses on the Windows 8 style app development that is brand new and not available in any previous versions of the operating system. It treats the existing technologies only in the context of Windows 8 style app development.

After reading this book, you will be familiar with the following general areas:

  • The architectural basics of the new application development platform
  • The fundamental new principles and traits of Windows 8 application development — using both .NET languages and HTML/JavaScript
  • The basics of Windows 8 style app development using the HTML5/CSS3/JavaScript web technologies
  • The XAML markup used to create a Windows 8 style app UI with the built-in UI controls
  • The creation of a more complex UI with multiple pages and new commanding surfaces introduced in Windows 8
  • The fundamental APIs of Windows Runtime, which is used to create full-fledged applications that leverage touch and tablet features
  • The scenarios in which the C++ programming language is the right choice
  • The distribution and sale of your apps in the Windows Store

You learn about these topics through hands-on exercises that walk you through the use of Microsoft Visual Studio 2012 Express for Windows 8 in tandem with Microsoft Expression Blend to create Windows 8 style apps.

How This Book Is Structured

This book is divided into three sections that will help you understand the concepts behind Windows 8 application development as well as become familiar with the fundamental tools and techniques.

  • The first part provides a quick overview that presents the fundamental changes brought into application development by Windows 8 — including the user experience scenarios, UI concepts, application architecture, and tools.
  • In the second part, the numerous hands-on exercises enable you to learn the main concepts, fundamental techniques, and best practices of Windows 8 style application development.
  • The third part introduces a few advanced topics that help you to step toward becoming a professional Windows 8 app developer.

Most chapters first establish a context and treat the essential concepts, illustrated with figures and code snippets. You learn how to use these concepts through hands-on exercises, in which you build Windows 8 apps from scratch and improve the ones you built earlier. Each exercise concludes with a “How It Works” section that explains how (including all important details) the exercise achieves its objective.

Part I: Introduction to Windows 8 Application Development

Windows 8 totally changes the landscape of application development with the new style of app. In this part, you become acquainted with the fundamental concepts, technologies, and tools that make it possible to leverage these great features.

  • Chapter 1: “A Brief History of Windows Application Development”—Windows 8 represents the biggest leap in the entire lifetime of the operating system family. Here you learn how the operating system evolved during the past 27 years, and then you traverse the development technologies and tools as they developed in tandem with Windows.
  • Chapter 2: “Using Windows 8”—Windows 8 changes a lot in terms of the UI. It was built with a more touch-centric approach in mind. Although the user may learn these things intuitively, for a developer, it is imperative to know all the nooks and crannies of using the Windows 8 UI. After reading this chapter, you will get the sense of building really engaging and intuitive apps that users use not just to complete a task but enjoy using.
  • Chapter 3: “Windows 8 Architecture from a Developer’s Point of View”—Windows 8 provides a new development model via a new kind of application — Windows 8 style apps — while still allowing for the development of traditional desktop applications. Here you learn the architecture of components that help you to develop these kinds of apps, including the cornerstone, Windows Runtime.
  • Chapter 4: “Getting to Know Your Development Environment”—Microsoft provides great tools to leverage the magnificent Windows 8 technologies. In this chapter, you learn about the two fundamental tools you are going to utilize while developing your apps: Visual Studio 2012 and Expression Blend.

Part II: Creating Windows 8 Applications

In this part, you learn the indispensable concepts and patterns you need to know about developing Windows 8 applications. You start with modern principles and move toward creating application UIs. Having this knowledge, you shift to techniques and components that enable you to develop full-fledged Windows 8 style apps.

  • Chapter 5: “Principles of Modern Windows Application Development”—Before you start to program, you must understand the basic principles of modern Windows application development. Here you learn about the key concepts of the Windows 8 design language, and then you explore and try out the brand new asynchronous programming patterns in C# and JavaScript.
  • Chapter 6: “Creating Windows 8 Style Applications with HTML5, CSS, and JavaScript”—Windows 8 enables web developers to build on their past experiences because they can utilize their existing HTML, CSS, and JavaScript knowledge. This chapter provides a brief overview of these technologies in regard to Windows 8 style app development.
  • Chapter 7: “Using XAML to Create Windows 8 Style User Interfaces”—In this chapter, you learn about the basics of developing Windows 8 style application UIs using eXtensible Application Markup Language (XAML). XAML provides a way to develop the UI with a rich set of tools, including layout management, styles, templates, and data binding, as you will discover here.
  • Chapter 8: “Working with XAML Controls”—Windows 8 provides a number of predefined UI controls, including buttons, text boxes, lists, grids — any many more — that can be used in XAML. In this chapter, you learn not only how to use these controls, but how to transform and customize them, and how to utilize Expression Blend.
  • Chapter 9: “Building Windows 8 Style Applications”—Windows 8 style applications use a set of patterns to provide a uniform user experience. Here you learn about patterns that determine how your application can implement the same user interaction experience as the new apps that are shipped as a part of Windows 8. You also learn important details about integrating your apps with the operating system’s Start screen.
  • Chapter 10: “Creating Multi-Page Applications”—In this chapter, you learn how to create applications with multiple pages. You start by studying the navigation concepts used in Windows 8 style apps, and you get acquainted with the UI controls that support paging. Visual Studio provides two project templates — the Grid Application template and the Split Application template — that are great for starting your multi-page apps. Here you discover the details surrounding these templates.
  • Chapter 11: “Building Connected Applications”—Modern applications often leverage services available on the Internet, such as weather information, financial services, social networks, and many others. In this chapter, you learn how to utilize Windows 8 features that enable you to develop connected applications using these Internet services as building blocks.
  • Chapter 12: “Leveraging Tablet Features”—Windows 8 is very focused on tablets with touchscreen devices and various sensors. Here you discover the APIs that enable you to integrate touch experience and sensor information into your apps to provide a great tablet-aware user experience.

Part III: Advancing to Professional Windows 8 Development

The topics treated in this part widen your knowledge of Windows 8 style app development. Here you learn concepts and techniques that enable you to start creating professional apps and even monetize them through the Windows Store.

  • Chapter 13: “Creating Windows 8 Style Applications with C++”—The C++ programming language has experienced a renaissance because of its performance characteristics. Now you can develop Windows 8 style apps with C++. In this chapter, you learn how the newest version of C++ supports Windows 8 apps, and in which scenarios C++ is the best choice.
  • Chapter 14: “Advanced Programming Concepts”—In this chapter, you learn several concepts that enable you to develop more advanced Windows 8 style apps, such as hybrid projects that mix several programming languages, background tasks, and querying input devices and touch capabilities.
  • Chapter 15: “Testing and Debugging Windows 8 Style Applications”—Creating high-quality apps is important if you want to achieve success with them. Here you learn how to write additional code to test your application logic to ensure that your code behaves exactly the way it should. You will also learn indispensable debugging techniques to find the root causes of malfunctions in your code.
  • Chapter 16: “Introducing the Windows Store”—As a developer, you can submit your application to the Windows Store to enable users to buy and install it seamlessly. In this chapter, you learn about the prerequisites and the flow of the submission process, as well as other tools that help you in this workflow.

What You Need to Use This Book

Windows 8 supports two separate hardware platforms. One of them is the Intel platform (just as all previous Windows versions have supported it), including the 32-bit x86 and 64-bit x64 versions. The other one is based on the ARM processor architecture (typically used on mobile phones and touchscreen tablet devices), and this platform (Windows on ARM) is new in the Windows family of operating systems.

To create Windows 8 style applications, you need the development tools, and those run only on the Intel platform. So, you must install either the x86 or the x64 version of Windows 8 on your computer used for development. As of the writing of this book, Windows on ARM is not available.

You can use Microsoft Visual Studio 2012 and Microsoft Expression Blend to create Windows 8 style apps. If you have an appropriate Microsoft Developer Network (MSDN) subscription, you may have licenses for using these tools. Otherwise, you can download Microsoft Visual Studio 2012 Express for Windows 8 — including Expression Blend — for free. This book uses the Express version. Owing to the development tools, the Windows 8 style apps you create will run on both the Intel and ARM platforms.

Conventions

To help you get the most from the text and keep track of what’s happening, we’ve used a number of conventions throughout the book.


Try It Out
The “Try It Out” is an exercise you should work through, following the text in the book.
1. It usually consists of a set of steps.
2. Each step has a number.
3. Follow the steps through with your copy of the database.
How It Works
After each “Try It Out” exercise, the code you’ve typed is explained in detail.

As for styles in the text:

  • We highlight new terms and important words when we introduce them.
  • We show keyboard strokes like this: Ctrl+A.
  • We show filenames, URLs, and code within the text like so: persistence.properties.
  • We present code in two different ways:
    We use a monofont type with no highlighting for most code examples.
    We use bold to emphasize code that is particularly important in the present
         context or to show changes from a previous code snippet.

Source Code

As you work through the examples in this book, you may choose either to type in all the code manually, or to use the source code files that accompany the book. All the source code used in this book is available for download at http://www.wrox.com. When at the site, simply locate the book’s title (use the Search box or one of the title lists) and click the Download Code link on the book’s detail page to obtain all the source code for the book.


NOTE Because many books have similar titles, you may find it easiest to search by ISBN; this book’s ISBN is 978-1-118-01268-0.

Once you download the code, just decompress it with your favorite compression tool. Alternatively, you can go to the main Wrox code download page at http://www.wrox.com/dynamic/books/download.aspx to see the code available for this book and all other Wrox books.

Errata

We make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books (like a spelling mistake or faulty piece of code), we would be very grateful for your feedback. By sending in errata, you may save another reader hours of frustration, and at the same time, you will be helping us provide even higher quality information.

To find the errata page for this book, go to http://www.wrox.com and locate the title using the Search box or one of the title lists. Then, on the book details page, click the Book Errata link. On this page, you can view all errata that has been submitted for this book and posted by Wrox editors. A complete book list, including links to each book’s errata, is also available at www.wrox.com/misc-pages/booklist.shtml.

If you don’t spot “your” error on the Book Errata page, go to www.wrox.com/contact/techsupport.shtml and complete the form there to send us the error you have found. We’ll check the information and, if appropriate, post a message to the book’s errata page and fix the problem in subsequent editions of the book.

P2P.WROX.COM

For author and peer discussion, join the P2P forums at p2p.wrox.com. The forums are a web-based system for you to post messages relating to Wrox books and related technologies, and to interact with other readers and technology users. The forums offer a subscription feature to e-mail you topics of interest of your choosing when new posts are made to the forums. Wrox authors, editors, other industry experts, and your fellow readers are present on these forums.

At http://p2p.wrox.com, you will find a number of different forums that will help you, not only as you read this book, but also as you develop your own applications. To join the forums, just follow these steps:

1. Go to p2p.wrox.com and click the Register link.
2. Read the terms of use and click Agree.
3. Complete the required information to join, as well as any optional information you wish to provide, and click Submit.
4. You will receive an e-mail with information describing how to verify your account and complete the joining process.

NOTE You can read messages in the forums without joining P2P, but in order to post your own messages, you must join.

Once you join, you can post new messages and respond to messages other users post. You can read messages at any time on the web. If you would like to have new messages from a particular forum e-mailed to you, click the Subscribe to this Forum icon by the forum name in the forum listing.

For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to questions about how the forum software works, as well as many common questions specific to P2P and Wrox books. To read the FAQs, click the FAQ link on any P2P page.

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

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