Tài liệu Beginning Windows Phone App Development pdf

538 8.9K 4
Tài liệu Beginning Windows Phone App Development pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... framework was subsequently ported to Windows Phone Once you have installed the Windows Phone developer tools, you can start to build your first Windows Phone application 15 CHAPTER 2  BUILDING WINDOWS PHONE APPLICATIONS Building Your First Windows Phone Application In this section, you’ll build a simple Hello World application using the Silverlight framework Creating the application will provide you with... INTRODUCING WINDOWS PHONE AND THE WINDOWS PHONE PLATFORM Application Development Life Cycle It’s important to understand the application development life cycle helps you prepare for it In-depth discussion of the application development life cycle, including the certification process, is provided in Chapter 5 Figure 1-6 shows a high-level view of the development life cycle of a Windows Phone application... more Windows Phone devices You can find more information on the release of new Windows phones at www.microsoft.com/windowsphone/en-us/buy/7/phones.aspx In the next section, you will learn how the software behind these powerful consumer smartphones provides a great platform for developers Windows Phone Application Platform Microsoft did not invent any new languages or frameworks for the Windows Phone application... work as well • The Windows Phone emulator: This is used to run and test the Windows Phone application • Silverlight for Windows Phone: This is the Silverlight framework for Windows Phone, based on Silverlight 3 technology See Chapter 1 for a description of the subtle differences between Silverlight 3 and the Windows Phone Silverlight framework • Microsoft Expression Blend for Windows Phone: This tool... the Windows Phone controls 13 CHAPTER 2 Building Windows Phone Applications This chapter will prepare you with everything you need to get started with Windows Phone development You will learn about the Windows Phone emulator, Visual Studio 2010 Express, and Microsoft Expression Blend 4 You will use these tools to create your first Windows Phone application Before you can write your first application,... leave complex graphics and animations to Expression Blend 8 CHAPTER 1  INTRODUCING WINDOWS PHONE AND THE WINDOWS PHONE PLATFORM Figure 1-4 Microsoft Expression Blend 4 for Windows Phone Windows Phone Emulator The Windows Phone emulator, shown in Figure 1-5, is integrated with Visual Studio, and it simulates a real Windows Phone device However, there are things that you can’t do in the emulator For instance,... questions related to Silverlight for Windows Phone If you have other Windows Phone related questions, you can visit http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series The Windows Phone development team puts out many useful blogs that you can follow at http://windowsteamblog.com /windows_ phone/ b/wpdev/ Of course, there is Windows Phone documentation at MSDN; go to http://msdn.microsoft.com/en-us/library/ff402535(VS.92).aspx... Application template is a template for one-page applications The Windows Phone List Application template uses a ListBox control and page navigation framework to create applications with multiple pages The Windows Phone Class Library template can be used to create a class library that can be referenced by other Windows Phone projects 17 CHAPTER 2  BUILDING WINDOWS PHONE APPLICATIONS 4 For the purposes of this... modes of Windows Phone In the Windows Phone design view window, click the MY APPLICATION TextBlock In the Properties windows in the lower-right corner of the Visual Studio IDE, change the Text property from MY APPLICATION to HelloWorld Notice that the new text now appears on the design surface, as shown in Figure 2-4 19 CHAPTER 2  BUILDING WINDOWS PHONE APPLICATIONS Figure 2-4 Renaming the application... BUILDING WINDOWS PHONE APPLICATIONS Figure 2-1 Creating a new project in Visual Studio 2010 Express 3 From among the three C# templates that Visual Studio 2010 Express displays on its New Project dialog page, select the Windows Phone Application Visual C# template, as shown in Figure 2-2  Note There are three different Windows Phone Visual Studio 2010 Express project templates The Windows Phone Application . Introducing Windows Phone and the Windows Phone Platform 1  Chapter 2: Building Windows Phone Applications 15  Chapter 3: Building Windows Phone 7 Applications. INTRODUCING WINDOWS PHONE AND THE WINDOWS PHONE PLATFORM 9 Figure 1-4. Microsoft Expression Blend 4 for Windows Phone Windows Phone Emulator The Windows Phone

Ngày đăng: 14/02/2014, 12:20

Từ khóa liên quan

Mục lục

  • Cover

    • Contents at a Glance

    • Contents

    • About the Authors

    • About the Technical Reviewer

    • Acknowledgments

    • Introduction

  • Introducing Windows Phone and the Windows Phone Platform

    • Windows Phone Overview

    • Windows Phone Hardware Specifications

    • Windows Phone Application Platform

      • Silverlight for Windows Phone

      • XNA for Windows Phone

      • Tools

        • Visual Studio

        • Expression Blend

        • Windows Phone Emulator

        • Documentation and Support

      • Cloud Services

      • Metro Design

    • Application Development Life Cycle

    • Summary

  • Building Windows Phone Applications

    • Preparing Your Development Machine

    • Building Your First Windows Phone Application

      • Creating a Windows Phone Project

      • Using the Windows Phone Silverlight Controls

      • Writing the Windows Phone Code

      • Running the Silverlight Windows Phone Application

      • Customizing the Windows Phone Application

      • Styling Your Application

    • Summary

  • Building Windows Phone 7 Applications Using Cloud Services As Data Stores

    • Introducing the MVVM Pattern

    • Introducing Microsoft Azure and SQL Azure

    • Creating a Cloud Database

      • The Entity Framework

      • Creating an SQL Azure Database

        • Signing Up for SQL Azure

        • Connecting to the SQL Azure Project

        • Creating an SQL Azure Database

        • Testing the SQL Azure Database Connection

      • Creating a Database in SQL Azure

        • Using SQL Server Management Studio to Connect to the Cloud Database

        • Creating SQL Azure Database Tables

    • Creating a Cloud Service to Access the Cloud Database

      • Creating a Windows Azure Project

      • Generating an Object Model to Access the Cloud Database

      • Implementing a WCF Service to Access the SQL Azure Database

        • Coding the WCF Contract

        • Coding the Data Contract

        • Coding the Service

        • Testing the Azure WCF NotepadService on Your Machine

    • Building a Phone Client to Access a Cloud Service

      • Creating a Windows Phone Project

      • Building the UI

        • Building UserRegistrationUserControl

        • Building NoteListUserControl

        • Building MainPage

        • Declaring the UI Resources

        • Building the Main Page and Adding Components

      • Coding MainPage

        • Specifying the Namespaces

        • The Code Constructor

        • Coding the Save Button Event

        • Coding the View/Edit Button Event

        • Coding the AddNew Button Event

        • Coding the Delete Button Event

      • Coding BoolToVisibilityConvert

        • Specifying the Namespaces and Applying the IValueConverter Interface

        • Implementing IValueConvert

      • Adding a Reference to NotepadService

      • Coding NotepadViewModel

        • Specifying the Namespaces and Applying INotifyPropertyChanged

        • Initializing the Variables

        • Adding the Constructor

        • Adding SaveNote, AddUser, and DeleteNote

        • Adding NotepadService Event Handlers

        • Coding the INotifyPropertyChanged Interface

      • Testing the Application Against NotepadService Deployed Locally

      • Deploying the Service to Windows Azure

        • Preparing for Windows Azure NotepadService

        • Deploying NotepadService to Windows Azure

      • Testing the Notepad Application Against the NotepadService Azure Service

    • Summary

  • Catching and Debugging Errors

    • Debugging Application Exceptions

      • Debugging Page Load Exceptions

        • Catching an Exception

        • Querying Exception Object Values with Immediate Window

        • Catching an Unhandled Exception in RootFrame_NavigationFailed or Application_UnhandledException

        • Handling an Exception RootFrame_NavigationFailed

        • Fixing the Error in the Code

      • Debugging a Web Service Exception

        • Catching a Web Service Exception

        • Fixing the CalculatorService Exception

      • Testing the Application

    • Registering a Windows Phone Device for Debugging

    • Handling Device Exceptions

      • Creating the CatchDeviceExceptionDemo Project

      • Building the User Interface

        • Declaring the UI Resources

        • Building the Main Page and Adding Components

      • Coding the Application

        • Specifying the Namespaces

        • Initializing Variables

        • Implementing Accelerometer Start and Stop Behavior

      • Testing the Finished Application

    • Summary

  • Packaging, Publishing, and Managing Applications

    • Windows Phone Application Publishing Life Cycle

    • Windows Phone Application Certification Requirements

      • Application Policies

        • Windows Phone Application Binary (XAP File)

        • Things Your Application Must Not Do

        • Things Your Application Must Do

        • Location Service (GPS)

        • Push Notification Service (PNS)

      • Content Policies

      • Application Submission Validation Requirements

        • Packaging Requirements

        • Code Requirements

        • Using the Application Manifest File to Disclose Phone Features

        • Language Validation

        • Images for the Windows Phone Marketplace

      • Application Certification Requirements

        • Application Reliability

        • Performance and Resource Management

        • Phone Functionality

        • Security

        • Technical Support Information

    • Submitting Your First Windows Phone Application to the Windows Phone Marketplace

      • Packaging the Application

      • Submitting the Application

      • Updating Your Application

      • Finding Your Application in the Marketplace

    • Summary

  • Working with the Accelerometer

    • Understanding Orientation and Movement

      • Calculating Distance

      • Calculating Pitch, Roll, and Yaw

    • Introducing SDK Support for Accelerometers

    • Retrieving Accelerometer Data

      • Creating the CaptureAccelerometerData Project

      • Building the UI

        • Declaring the UI Resources

        • Building the Main Page and Adding Components

      • Coding the Application

        • Specifying the Namespaces

        • Initializing Variables

        • Capturing and Displaying Accelerometer Data

        • Implementing Accelerometer Start and Stop

      • Testing the Finished Application

    • Using Accelerometer Data to Move a Ball

      • Creating the MoveBall Project

      • Building the UI

        • Declaring the UI Resources

        • Building the Main Page and Adding Components

      • Coding the Application

        • Specifying the Namespaces

        • Initializing Variables

        • Handling Captured Accelerometer Data

        • Applying Captured Accelerometer Data to the Ball

        • Adding Start and Stop Button Events

      • Testing the Finished Application

    • Summary

  • Application Bar

    • Introducing the Application Bar

    • Adding an Application Bar to a Windows Phone Application

      • Adding Images for Use with Application Bar Buttons

      • Adding a Global Application Bar Using XAML

      • Adding a Local Application Bar Using XAML

      • Adding Menu Items

      • Adding an Application Bar Using Managed Code

    • Wiring Up Events to an Application Bar

      • Adding Glue Code and a Worker Function to the Add Button

      • Reacting to Add Button Events

      • Reacting to Save Button Events

      • Reacting to Menu Events

      • Adding Event Handlers with XAML

      • Using the ApplicationBar Class to Glue XAML and Managed Code

    • Summary

  • The WebBrowser Control

    • Introducing the WebBrowser Control

    • Adding a WebBrowser Control

    • Using a WebBrowser Control to Display Web Content

    • Using a WebBrowser Control to Display Local HTML Content

    • Using a WebBrowser Control to Display Dynamic Content

    • Saving Web Pages Locally

    • Choosing Display and Security Settings

    • Viewport

      • CSS

      • Security

    • A Brief Introduction to HTML5 Features

      • HTML5 Features

        • New Form Fields with HTML5

        • Geolocation

        • Media Playback

        • Canvas

        • SVG

      • Testing HTML5 Features on Windows Phone

        • Testing the Geolocation API

        • Testing Media Playback with the HTML5 <audio> Element

        • Drawing on an HTML5 Canvas

    • Summary

  • Working with Controls and Themes

    • Introducing the Metro Design System

      • Windows Phone Chrome

      • Screen Orientations

    • Themes on Windows Phone Devices

      • Applying a Theme

        • Creating a UI

        • Adding Code to Draw an Elliptical Shape

      • Changing the Theme

      • Detecting the Currently Selected Theme

    • Panorama and Pivot Controls

      • Using the Panorama Control

      • Using the Pivot Control

    • Understanding Frame and Page Navigation

      • Creating a UI for the NavigationTest Project

      • Adding Navigation Code

      • Adding Code to Pass Parameters Between Pages

    • Adding Transition Effects

      • Creating a UI

      • Downloading TiltEffect.cs and Applying Dependency Properties

    • Summary

  • Integrating Applications with the Windows Phone OS

    • Introducing Windows Phone Launchers and Choosers

      • Launchers

      • Choosers

    • Working with Launchers and Choosers

      • Creating the User Interface

      • Coding Application Logic

    • Working with the Windows Phone Application Life Cycle

      • Observing Application Life Cycle Events

        • Enhancing the User Interface

        • Adding Application Logic to Invoke the WebBrowserTask Launcher and to Log Events

        • Running the Application

      • Managing Application State

        • Managing State at the PhoneApplicationPage Level

        • Retrieving Application Initial State

      • Best Practices for Managing the Application Life Cycle on the Windows Phone OS

    • Integrating with Facebook

      • A Few Words about OAuth

        • Enhancing the User Interface for Facebook Integration

        • Adding Application Logic to Post to Facebook

    • Integrating into Windows Phone Hubs

      • Integrating Your Application with the Music and Video Hub

      • Integration with SharePoint

    • Summary

  • Creating Trial Applications

    • Understanding Trial and Full Modes

      • Using the IsTrial Method

        • Creating the UI

        • Coding the Application Logic

      • Using the Marketplace APIs

        • Enhancing the UI

        • Enhancing Application Logic

    • Building a Trial Application

      • Building the UI

      • Connecting to a Web Service

      • Adding Page-to-Page Navigation

      • Verifying Trial and Full Modes

      • Adding the Finishing Touches

    • Summary

  • Internationalization

    • Understanding Internationalization

    • Using Culture Settings with ToString to Display Dates, Times, and Text

    • Using the .NET Culture Hierarchy to Ensure Culture Neutrality

    • Storing and Retrieving Current Culture Settings

    • Using Resource Files to Localize Content

    • Localizing the Application Title and Tile

      • Creating an Application Resource File

      • Using Resource DLL from the Windows Phone Project

      • Creating Culture-Specific Resource DLLs

    • Summary

  • Isolated Storage

    • Working with Isolated Directory Storage

      • Creating the IsolatedStorageStoreImageDemo Project

      • Coding the UI

        • Selecting the UI Resources

        • Building the Main Page and Adding Components

      • Coding the Application

        • Specifying the Namespaces

        • Initializing Variables

        • Initializing the Application

        • Checking Availability of Isolated Storage Space

        • Adding a Button Event to Retrieve the Image from Isolated Storage

        • Adding a Method to Retrieve the Image from Isolated Storage

        • Testing the Finished Application

    • Working with Isolated Storage Settings

      • Creating a New Project

      • Building the Application UI (XAML)

        • Selecting the UI Resources

        • Building the Main Page and Adding Controls

      • Coding Application Behavior (C#)

        • Specifying the Namespaces

        • Initializing the Application

        • Adding the Save Button Event Handler

        • Adding the Delete Button Event Handler

        • Adding the ListBox Changed Event

        • Testing the Finished Application

    • Summary

  • Using Location Services

    • Understanding Windows Phone Location Services Architecture

    • Introducing the Windows Phone Location Service and Mapping APIs

    • Simulating the Location Service

      • Creating the GeoCoordinateWatcherDemo Project

      • Coding the UI

        • Declaring the UI Resources

        • Building the Main Page and Adding Components

      • Coding the Application

        • Specifying the Namespaces

        • Initializing Variables

        • Simulating GPS Data Using the Reactive Extension’s Observable Object

        • Displaying GPS Data

      • Testing the Finished Application

    • Using GeoCoordinateWatcher and the Bing Maps Control to Track Your Movements

      • Registering with the Bing Maps Service Portal and Installing the Bing Maps SDK

      • Creating the BingMapDemo Project

      • Coding the UI

        • Declaring the UI Resources

        • Building the Main Page and Adding a Bing Maps Control

      • Coding the Application

        • Specifying the Namespaces

        • Initializing Variables

        • Responding to StatusChanged and PositionChanged GeoCoordinateWatcher Events

        • Starting the Location Service: GeoCoordinateWatcher

        • Plotting the Location on the Bing Maps MapLayer

      • Testing the Finished Application

    • Plotting an Address on a Bing Maps Map and Working with the Bing Maps Service

      • Creating the AddressPlottingDemo Application

      • Adding a Service Reference to the Bing Maps GeoCodeService

      • Coding the UI

        • Declaring the UI Resources

        • Creating the Main Page

      • Coding the Application

        • Specifying the Namespaces

        • Initializing Variables

        • Handling the Button Event that Plots Address Data on the Bing Maps Map

      • Testing the Finished Application

    • Summary

  • Media

    • Introducing MediaElement

    • Working with Video

      • Creating the MediaPlayerDemo Project

      • Building the UI

        • Declaring the UI Resources

        • Building the Main Page and Adding Media Player Components

      • Coding the Application

        • Specifying the Namespaces

        • Initializing Variables

        • Handling Video Download Progress

        • Handling Video Buffering

        • Showing Time Elapsed in the Media Player

        • Implementing the Pause Button

        • Implementing the Stop Button

        • Implementing the Play Button

        • Implementing the Mute Button

        • Implementing Seek

        • Implementing MediaPlayerLauncher

        • Testing the Finished Application

    • Adding Sounds to an Application

      • Creating the RobotSoundDemo Project

      • Building the UI

        • Selecting the UI Resources

        • Adding the Robot Animation to the Main Page Resource Section

        • Building the Main Page and Adding Components

      • Coding the Application

        • Specifying the Namespaces

        • Adding an Event to Handle Play Button Clicks

        • Testing the Finished Application

    • Summary

  • Working with the Camera and Photos

    • Introducing Windows Phone Photo Features

      • Using a Chooser to Take Photos

        • Creating a New Project and Building the User Interface

        • Writing Code to Take Photos with CameraCaptureTask

      • Using a Chooser to Open Photos

      • Saving Photos to the Phone

        • Adding a Status Message

        • Writing Code to Save Photos with the XNA Framework

    • Integrating Your Application with Windows Phone

      • Using the Apps Link to Launch an Application

        • Adding an Entry in WMAppManifest.xml

        • Adding Code to Navigate to a Photo

      • Using Share to Upload PhotoCapture Snapshots to TwitPic

        • Adding an Entry to the WMAppManifest.xaml

        • Adding Code to Navigate to the Selected Photo

        • Adding an Upload Button to the UI

        • Writing Code to Transfer an Image to TwitPic

    • Manipulating Live Photo Feeds

    • Summary

  • Push Notifications

    • Understanding Push Notifications

      • Toast Notifications

      • Tile Notifications

      • Raw Notifications

    • Introducing the Push Notifications Architecture

      • The Life Cycle of a Notification

      • The Push Notification Framework

    • Implementing Toast Notifications

      • Creating a Client Application

      • Creating an Application to Send Notifications

        • Verifying Delivery of Push Notifications

        • Modifying the Windows Forms Notification Server to Pass Parameters

        • Modifying the Windows Phone Client to Receive Parameters from Toast Notifications

    • Implementing Tile Notifications

      • Creating a Client Application

      • Creating an Application to Send Notifications

        • Verifying Delivery of Push Notifications

    • Implementing Raw Notifications

      • Creating a Client Application

      • Creating an Application to Send Notifications

      • Testing Delivery of Raw Notifications

    • Implementing a Cloud Service to Track Push Notifications

      • Creating a WCF Service to Track Notification Recipients

      • Modifying the Client to Call the WCF Service

      • Verifying Automated Push Notification Subscriber Tracking

    • Using Push Notifications in the Real World

    • Setting Up Secure Web Services for Push Notifications

    • Summary

  • Reactive Extensions for .NET

    • Introducing Reactive Programming

    • Rx.NET Subscription Pipeline

    • Implementing the Observer Pattern with Rx.NET

      • Creating a Windows Phone Project

      • Adding Code to Create and Read Observable Collections

    • Using Rx.NET Event Handling to Search for Flickr Photographs

      • Creating a Windows Phone Project

      • Adding a User Interface

      • Adding Logic to Search Flickr for Images

      • Enhancing a Flickr Search with Throttling

      • Adding an Animation that Plays as Flickr Images Load

    • Rx.NET Design Guidelines

      • Consider Drawing a Marble Diagram

      • Consider Passing a Specific Scheduler to Concurrency-Introducing Operators

    • Using Rx.NET with Web Services to Retrieve Weather Data Asynchronously

      • Creating a Windows Phone Project

      • Creating a User Interface

      • Adding Logic to Get Weather Information

    • Handling Errors in Rx.NET

    • Handling Data-Connection Issues with Rx.NET

    • Revising WeatherRx to Manage Slow Data Connections

    • Handling Multiple Concurrent Requests with Rx.NET

    • Summary

  • Security

    • Understanding Application Security

      • The Windows Phone Marketplace

        • Non-Repudiation: Proof of the Integrity and Origin of Data

        • Intellectual Property Protection

        • Safe Application Behavior

      • Submitting an Application to the Windows Phone Marketplace

        • Generating a XAP Submission File

        • Uploading the XAP File to the Marketplace

      • Sandboxed Execution and the Execution Manager

      • Private Application Distribution Options

    • Implementing Network Security

      • Securing Connections with SSL

      • Testing and Opening an SSL Connection

      • Creating a Self-Signed Certificate

      • Exporting a Self-Signed Certificate

      • Installing a Self-Signed Certificate on Windows Phone

    • Implementing Data Security

      • Using HMACSHA1 and HMACHSHA256

        • Creating a UI

        • Coding the Application Logic

      • Using Rfc2898DeriveBytes and AES to Encrypt Data

        • Creating a UI

        • Coding the Application Logic

      • Information Rights Management

    • Understanding Device Physical Security

    • Meeting Certification Requirements

      • Applications Must Implement MSIL Code

      • Applications Must Not Implement Any Security-Critical Code

        • Transparent Code

        • Security-Safe-Critical Code

        • Security-Critical Code

      • Capability List

    • Obfuscating Your Application Code

    • Summary

  • Index

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    • I, J, K

    • L

    • M

    • N

    • O

    • P, Q

    • R

    • S

    • T

    • U

    • V

    • W

    • X, Y

    • Z

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan