Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Windows Phone 8 Development Internals
Dedication
A Note Regarding Supplemental Files
Foreword
Introduction
Who should read this book
Assumptions
Who should not read this book
Organization of this book
Conventions and features in this book
System requirements
Code samples
Installing the code samples
Using the code samples
Acknowledgments
Errata & book support
We want to hear from you
Stay in touch
I. Core Features
1. Vision and architecture
A different kind of phone
The user interface
Light and simple
Typography
Motion
Content, not chrome
Honesty in design
The role of apps
Windows phone architecture
Platform stack
App types
Background processing
Background OS services
Background transfer service
Alarms
Background audio agents
Scheduled tasks
Continuous background execution for location tracking
Security model
Windows and Windows Phone: together at last
Shared core
Windows Runtime
Building and delivering apps
Developer tools
Windows Phone emulator system requirements
Building for Windows Phone 7.x and 8.x
App delivery
Getting started with “Hello World”
Creating a project
Understanding the project structure
Greeting the world from Windows Phone
Deploying to a Windows Phone device
The Windows Phone Toolkit
Summary
2. App model and navigation
The app lifecycle
Normal termination
App deactivated—fast app resume
App deactivated—the tombstone case
Setting a resume policy
Obscured and Unobscured
The page model
Page creation order
Navigation and state
App state
Page state
Cancelling navigation
Backstack management
Navigation options
Using NavigateUri
Pages in separate assemblies
Fragment and QueryString
The NavigationMode and IsNavigationInitiator properties
Re-routing navigation and URI mappers
File type and URI associations
Starting an app based on a file or URI
Acting as a file type or URI handler
Manifest registration
Handling activation
Accessing launched files
Summary
3. UI visuals and touch
Phone UI elements
Standard UI elements
The visual tree
Screen layout
Working with UserControls vs. custom controls
Re-templating controls
Resources
Data resources
XAML resources and resource dictionaries
Implicit styles
Dependency and attached properties
Dependency properties
Attached properties
The app bar and notification area
Transient panels
Routed events
Logical touch gestures
Manipulation events
Mouse events
FrameReported events
Keyboard input
Summary
4. Data binding and MVVM
Simple data binding and INotifyPropertyChanged
Data-binding collections
Dynamic data-bound collections
Command binding
Template resources
Sorting and grouping bound collections
Type/value converters
Element binding
Data validation
Separating concerns
The Model-View-ViewModel pattern
The Visual Studio databound application project
MVVM in Pivot apps
Row filtering in Pivot apps
Improving the Visual Studio Databound Application template
Summary
5. Phone and media services
Launchers and Choosers
Search extensibility
App Connect
App Instant Answer
Audio and video APIs
Media playback
The MediaPlayerLauncher
The MediaElement class
The MediaStreamSource and ManagedMediaHelpers classes
The MediaElement controls
Audio input and manipulation
The SoundEffect and SoundEffectInstance classes
Audio input and the microphone
The DynamicSoundEffectInstance class
Music and Videos Hub
The Clipboard API
Summary
6. Sensors
Orientation
Phone hardware
Sensor APIs
The accelerometer
Reactive extensions
The Level Starter Kit
Shake
Compass
Gyroscope
Motion APIs
Summary
7. Web connectivity
The WebClient and HttpWebRequest classes
Using the async pack
Using the Task Parallel Library
The WebBrowser control
Local webpages
Integrating with JavaScript
Live SDK
SkyDrive
Facebook
Twitter
The Data Sense feature
Summary
8. Web services and the cloud
Web services
Localhost and the emulator
Connecting to the web service
SOAP vs. REST
WCF data services
Creating an OData client
Filtered queries
Dynamic query results
Paging the data
Caching the data
JSON-formatted data
Web service security
Windows Azure
Windows Azure web services
Windows Azure Mobile Services for Windows Phone
Summary
9. Background agents
Background tasks
Alarms and reminders
Alarms
Reminders
The Background Transfer Service
Generic Background Agents
GBA components
Updating tiles
The lock-screen background
Lock-screen notifications
Background audio
Background audio application
Background audio agent
Summary
10. Local storage and databases
Local storage
Isolated storage APIs
Isolated storage settings
Isolated storage files
Windows Runtime storage
Win32 APIs
LINQ-to-SQL
Defining the database in code
Performing queries
Create/update/delete
Associations
Handling schema changes
Prepopulating a reference database
Maximizing LINQ-to-SQL performance
Minimizing memory usage
Speeding up batch updates
SQLite
Acquiring SQLite for Windows Phone
Using SQLite from managed code
Summary
II. Windows Phone 7 to Windows Phone 8
11. App publication
Preparing for publication
The publication process
Dev Center reports
Updates
Beta testing
Versions
Selective targeting
Device capabilities
Device memory
Summary
12. Profiling and diagnostics
Debugging
Targeting different device configurations
Troubleshooting app startup
Using Fiddler with the Windows Phone emulator
Testing
Unit testing
Simulating real-world conditions
Testing tombstoning
The Windows Phone emulator
Emulator keyboard shortcuts
Emulator vs. device
Profiling
Frame rate counters
Redraw regions
DeviceStatus Memory APIs
The Windows Phone Performance Analysis Tool
The app analysis report
Memory analysis report
Profiling native code
Performance best practices
Keep the user engaged
Stay off of the UI thread
Simplify the visual tree
Easy wins with photos
Use LongListSelector instead of ListBox for large collections
Use panorama thoughtfully
Summary
13. Porting to Windows Phone 8 and multitargeting
Lighting up a Windows Phone 7 App with Windows Phone 8 features
Creating Windows Phone 8 tiles in a Windows Phone 7 App
Registering for the tiles AppExtra
Checking the OS version
Upgrading existing tiles
Adding new tiles
Simulating OS upgrade and App update
Quirks mode and breaking changes
Quirks mode
Breaking changes
Use of MessageBox during app lifecycle events
Anonymous user ID
FM radio
Photo apps picker
LayoutUpdated timing
The WebBrowser control
General rendering and scrolling
User agent string
Text input events
Slider control
XML serialization
The LongListSelector control
Read-only database connections in local storage
Managing platform-specific projects
Create distinct apps for Windows Phone 7.1 and Windows Phone 8
Share a Windows Phone 7.1 library
Link source code files
Create abstract base classes and partial classes
Windows Phone 7.8 SDK
Test coverage for Windows Phone 7.x apps
Summary
14. Tiles and notifications
Tile sizes and templates
Secondary tiles
Pinning tiles
Cross-targeting Windows Phone 7
Push notifications
Push notification server
Push notification client
Registration web service
Additional server features
Batching intervals
XML payload
Response information
Additional client features
The ErrorOccurred event
User opt-in/out
Implementing a push viewmodel
Push notification security
Summary
15. Contacts and calendar
Contacts
Understanding the People Hub
Querying device contacts
Single-contact choosers
Querying contacts programmatically
Adding contact information
Creating a custom contacts store
Calendar
Querying the calendar
Creating a new appointment
Summary
16. Camera and photos
Acquiring a single photo
Working with the media library
Reading photos
Adding new images
Capturing photos
The PhotoCamera class
The PhotoCaptureDevice class (Windows Phone 8 only)
Preparing the device and capture sequence
Manipulating the preview buffer
Capturing a photo
Capturing video
Extending the Photos Hub
Apps pivot
The photo apps picker and photo edit picker
The photo apps picker (Windows Phone 7.1 only)
The photo edit picker (Windows Phone 8 only)
Lenses
Launching from the camera
Rich media editing
Sharing photos
Share picker
Auto-upload
Summary
17. Networking and proximity
Sockets
The Windows Runtime sockets API
.NET sockets
The WinSock API
Finding your app on nearby devices
Finding peers through Bluetooth
Finding peers through tap-to-connect
Reconnecting without retapping
Tap-to-connect with a Windows 8 app
Connecting to other Bluetooth devices
NFC
Reading and writing NFC tags
Writing URIs to tags
Writing NDEF messages directly
Writing a LaunchApp tag
Sending a URI across devices
Summary
18. Location and maps
Architecture
Determining the current location (Windows Phone 7)
Bing maps (Windows Phone 7)
The Bing Map control
Bing maps web services
Bing Maps Launchers
Getting location (Windows Phone 8)
Maps API (Windows Phone 8)
The Map control
Route and directions
Maps Launchers
Continuous background execution (Windows Phone 8)
Testing location in the simulator
Location best practices
Summary
III. New Windows Phone 8 Features
19. Speech
Voice commands
The GSE
Building a simple voice commands App
Registering voice commands
Initializing the VCD file
Handling invocation for simple voice commands
Adding flexibility by using labels
Updating PhraseLists at run time
Speech recognition in apps
Simple recognition with built-in UX
Customizing the recognizer UI
Adding custom grammars
Adding predefined grammars
Adding simple lists
Adding grammars by using speech recognition grammar specification
Text-to-Speech
Simple TTS with SpeakTextAsync
Taking control with speech synthesis markup language
Crafting the speech output
Keeping speech and screen in sync
Putting it together to talk to your apps
Summary
20. The Wallet
Understanding the Wallet
The Wallet and Near Field Communication
The Wallet Hub
The Wallet object model
Managing deals
Transaction items
Adding and removing the account in the app
Handling the addition and removal of accounts in the Wallet
Payment instruments
Wallet agents
Summary
21. Monetizing your app
Advertising
Integrating the Ad Control
Ad Control design guidelines
Positioning
Integration with panorama and pivot controls
Creating a common Ad Unit across all pages
Registering with Microsoft pubCenter
Trial mode
In-app purchase
Division of responsibilities
Types of IAP content
Configuring the mock IAP library
Purchasing durable content
Purchasing consumable content
Configuring IAP inventory
Summary
22. Enterprise apps
Windows Phone for business
Managed vs. unmanaged phones
MDM and managed phones
Managed enrollment
Unmanaged phones
Unmanaged enrollment
Company Apps
Building a company hub app
Summary
IV. Native Development and Windows Phone 8 convergence
23. Native development
Native code overview
When to use native code
Portability
Reusability
Performance
An introduction to modern C++
Smart pointers
Unique pointers
Shared Pointers
Type Inference
Foreach loops
Lambdas
Scoped, strongly typed enums
What about properties and events?
Managed-native interop
Creating the Windows Runtime component
Consuming the Windows Runtime component from C#
Debugging mixed-mode projects
Writing asynchronous code in C++
Moving synchronous code to the background
Providing progress updates
Cancelling asynchronous operations
Using Windows Runtime classes in C++
Win32 API
Component Object Model (COM)
Supported platform COM libraries
Using custom COM libraries
Summary
24. Windows 8 convergence
Windows 8 and Windows Phone 8 compared
Developer tools and supported languages
Application models
Frameworks
Windows Phone framework namespaces explained
Windows Runtime API comparison
Non-converged frameworks
Direct3D
Background processing
Generic background processing
Background audio
Voice over IP
Background location tracking
Authoring Windows Runtime components on Windows Phone
Sharing code between Windows and Windows Phone
Deciding when and how to share code
Code sharing and Model-View-ViewModel
Sharing .NET code by using the PCL
Creating the project
Handling platform differences
Linked files and conditional compilation
Sharing managed code with partial classes
Sharing native code
Sharing XAML-based UI with user controls
Dealing with built-in styles
Taking the UserControl cross-platform
Reusing phone UI in Windows snapped view
Summary
25. Games and Direct3D
Direct3D primer
Direct3D differences on Windows Phone
Visual Studio project types
Direct3D and XAML projects
Structure of the basic Direct3D app
The CoreApplication and CoreWindow classes
Starter code classes
Initializing Direct3D
A brief word about the Component Object Model
DirectX hardware feature levels
Update and render
Minimal Direct3D app
Touch input
Direct2D and DirectXTK
Summary
A. About the Authors
Index
About the Authors
Copyright
← Prev
Back
Next →
← Prev
Back
Next →