what's new in wp8

What's new in Windows Phone SDK 8.0

Windows Phone 8 brings a number of new and updated features to app developers, including native gaming development, a phone-specific version of the Windows Runtime, and a new kernel. We’ve put together this introduction to help you become acquainted with new and updated features in Windows Phone 8 and Windows Phone SDK 8.0. We’re proud of the tools you have at hand in the SDK. They’re tools that can help you create the Windows Phone apps that give your users even more reasons to love their Windows Phone. Here we give you a glimpse of the features available to you to use in your app development, and how to learn more about them.

Windows Phone SDK 8.0 includes the following new tools and features for developing, debugging, and testing apps.

Development tools and features

Visual Studio  includes the following new features.

  • Project templates for Direct3D apps. For more info about project templates, see How to create a new app project from a template for Windows Phone. For more info about Direct3D apps, see the sectionDirect3D and games in this topic.

  • Enhanced localization support in project templates. Project templates now include built-in support for localization. You can easily begin to use best practices to develop a localized app without a lot of configuration steps. For more info, see How to build a localized app for Windows Phone.

  • Debugging managed or native code. On the Debug page of Project Designer, you can choose whether to debug the managed code or the native code portion of your app. If your app communicates with a background agent, you can also choose whether to debug the managed code or the native code portion of the background agent independently. You can debug both the app and the background agent in the same debugging session.

  • Debugging apps launched from a tile or notification. You can now debug an app that targets Windows Phone 8 when it's launched from a Tile or a push notification, not only when it's launched directly. When you launch your app with debugging on Windows Phone 8 Emulator or on a Windows Phone 8 device, click the Back button to exit the app; the debugger remains attached. After you launch the app again by using the Tile or push notification, you can continue to debug the app. For more information, see Debugging apps for Windows Phone.

  • XNA Framework support. You cannot develop new XNA Framework apps that target Windows Phone 8. For more info, see XNA Framework and Windows Phone 8 development.

Windows Phone 8 Emulator  includes the following new features.

  • Support for multiple resolutions. Emulator images are available for each of the three resolutions supported in Windows Phone 8. For more info, see Multi-resolution apps for Windows Phone 8.

  • System requirements for Windows Phone 8 Emulator . Windows Phone 8 Emulator runs on Windows Hyper-V and has the same hardware, software, and configuration requirements as Hyper-V. If your computer doesn’t support Hyper-V, you can still develop apps for Windows Phone 8 and debug and test them on a Windows Phone 8 device. For more info, see System requirements for Windows Phone Emulator.

  • Networking on Windows Phone 8 Emulator . The Windows Phone OS 7.1 emulator uses the network connection of the development computer. However, the Windows Phone 8 Emulator configures itself as a separate device on the network. For more info about the impact of this change, see Windows Phone Emulator.

Manifest Designer. You can now add, remove, and change elements in the app manifest file through a user-friendly user interface. For more info, see How to modify the app manifest file for Windows Phone.

Isolated Storage Explorer has new command-line options that let you specify the target device. For more info, see How to use the Isolated Storage Explorer tool for Windows Phone.

Testing tools and features

Testing your app’s native image. You can test the app’s native image to experience its performance as users will experience it. For more info, see How to test the retail version of your app for Windows Phone 8.

App monitoring and profiling. Windows Phone Application Analysis (formerly Windows Phone Performance Analysis) now includes app monitoring in addition to app profiling. The app monitoring feature captures the key metrics for your app that are relevant from a quality perspective, and then rates your app based on the metrics. The guiding principle is to help you ensure app quality and performance while you’re developing your app, and not as an afterthought. For more info, see App monitoring for Windows Phone.

Simulation Dashboard. You can use the Simulation Dashboard in Windows Phone 8 to determine in advance how your app will respond to real-life conditions. With this info, you can adjust your app to ensure that the app performs well in various real-life scenarios, and that your users are satisfied with the app.

You can use the Simulation Dashboard to test how your app will respond to the following conditions:

  • A low-bandwidth connection or poor signal

  • An interruption, such as a reminder or notification

  • The lock screen

For more info, see Simulation Dashboard for Windows Phone.

Screen shots. You can now capture screen shots of your app running on a physical phone by using a special key combination. For more info, see How to create screenshots for Windows Phone Store.

Store Test Kit. The Marketplace Test Kit is renamed the Store Test Kit. The Capabilities Validation test is not available for apps that target Windows Phone 8.

Windows Phone 8 includes new Tile sizes, and new Tile templates, accessible with the following classes:

For more info about new Tiles in Windows Phone 8, see Tiles for Windows Phone.

In Windows Phone 8, a user can use your app as the lock screen background image provider, and choose to include your app in the lock screen notification area. For more info about using new lock screen capabilities in your Windows Phone 8 app, see Lock screen notifications for Windows Phone 8 and Lock screen background for Windows Phone 8.

 

Maps

Windows Phone 8 has a new Map control, available through the following namespaces:

For more info about the new Map control, see Maps and navigation for Windows Phone 8.

Navigation

In Windows Phone 8 you can use the navigation protocol with the ms-drive-to or ms-walk-to Uri schemes to write an app that requests driving or walking directions, or to write an app that handles requests for driving or walking directions. For more info, see How to request or provide directions for Windows Phone 8.

Windows Phone 8 provides a new Windows Phone Runtime-based API set for getting the phone’s current location. The existing .NET Location API is still supported. For more info about the new APIs, see Location for Windows Phone 8.

Another new feature in Windows Phone 8 is the ability for location-tracking apps to continue to run in the background after the user navigates away from the app. This enables scenarios like run tracking and turn-by-turn navigation apps.

In Windows Phone 8, users can interact with your app using their voice. For more info about using new speech features in your Windows Phone 8 app, see Speech for Windows Phone 8.

Windows Phone 8 introduces the Wallet, which app users can use to do the following:

  • Collect coupons, credit cards, memberships, loyalty cards, and more in one place.

  • Manage the payment instruments that they use in the app and music store.

  • Link items in the Wallet to apps on their phone.

  • Make contactless transactions, using Near-Field Communication (NFC), in some markets.

The Wallet gives app developers the ability to provide users with a richer experience by integrating with their Wallet items. Using the functionality provided through the Wallet namespace, you can create, read, write, and delete Wallet items from your app. Through the Windows Phone 8 Wallet experience, you can keep items up-to-date by using agents, and interact with the user with status messages and custom fields. The Wallet integration is additional functionality that allows you to better reach customers by being able to engage with them on an additional new surface area. In addition, Wallet items enable users to deep link in to your app so that you can provide a more meaningful in-app experience. For more info about the Wallet in Windows Phone 8, see Wallet for Windows Phone 8.

Windows Phone 8 supports WVGA, WXGA, and 720p devices. The following table lists the new resolutions. All of these resolutions are supported in Windows Phone 8 Emulator.

 
 

Resolution

Aspect ratio

Scaled resolution

WVGA

480 × 800

15:9

480 × 800

WXGA

768 × 1280

15:9

480 × 800

720p

720 × 1280

16:9

480 × 853

For more info about multi-resolution support in Windows Phone 8, see Multi-resolution apps for Windows Phone 8.

In addition to native development, Direct3D is being added to the family of Windows Phone technologies. This means that for the first time, a Direct3D-based PC game can share much of its code base with a phone version, and developers can use state-of-the-art middleware tools and engines that power the industry’s biggest game titles to develop games for Windows Phone.

Direct3D app refers to apps that are written entirely in native code, and which use only Direct3D for their UI. This type of app uses a completely different app model than managed apps, and can’t use many of the features of managed apps, such as live Tiles and push notifications. However, in Windows Phone 8 several new features were added for Direct3D apps to provide software keyboard input support, device theme, and screen resolution detection, and a set of Launchers and Choosers for adding many common phone tasks to your Windows Phone app. For more info about the native Direct3D app model and the features available to this type of app, seeDirect3D app development for Windows Phone 8.

Also, you can use the DrawingSurface and DrawingSurfaceBackgroundGrid controls to incorporate Direct3D graphics into managed apps to take advantage of managed code features with a very small performance loss. Windows Phone 8 supports a subset of the Direct3D library at the 9_3 feature level. For info about Direct3D feature support and compatibility, see Direct3D for Windows Phone 8. For info about using Direct3D from managed apps, see XAML and Direct3D apps for Windows Phone 8.

In addition to Direct3D graphics support, you also have access to Microsoft Media Foundation APIs for playback and capturing audio and video. Also, the native audio libraries, XAudio2 and WASAPI, are now supported on the phone. For more info, see Walkthrough: Using Microsoft Media Foundation for Windows Phone 8 and Native audio APIs for Windows Phone 8.

Windows Phone 8 supports two distinct app models on which you can base your app.

Managed

Managed apps use XAML to define the user interface and Visual Basic or C# as the coding language. Existing Windows Phone apps that were written using these techniques are fully compatible with Windows Phone 8. XAML-based apps have gained new features such as new controls and auto-scaling to high resolution. New managed APIs coming to Windows Phone 8 include a new map control powered by Nokia maps and a wallet API for storing payment methods and enabling NFC-based payments.

Native

Windows Phone 8 supports native development, including significant subset of the Windows 8 SDK, enabling developers to share a significant amount of code between Windows 8 and the phone, particularly for native apps. With the addition of native development support, Windows Phone 8 reduces the need to port and maintain components such as compute engines, graphic libraries, and API sets.

Direct3D and XAML

Direct3D and XAML app development is an attractive choice for developers who want the graphics capabilities of Direct3D but also want to use some of the features only available to managed apps such as Tiles and XAML controls.

HTML

HTML-based phone apps aren’t a supported app model in Windows Phone 8. However, a developer can create a managed app with a XAML front end that uses an embedded browser control to display local HTML content, and it’s possible to access phone APIs by using the InvokeScript method and ScriptNotify events. Also, in Windows Phone 8, the phone’s browser has been upgraded to Internet Explorer Mobile 10, with a host of new features such as a robust HTML5/CSS3 implementation, Scalable Vector Graphics (SVG), ES5, IndexedDB, gesture events, and the addition of the high-performance scripting engine, creating new, interesting possibilities for Windows Phone 8 HTML developers.

For more information about developing with Internet Explorer Mobile 10, see the Internet Explorer 10 Guide for Developers.

Windows Phone 8 introduces Lenses, the ability to auto-upload photos to a web service, new ways to extend the photos experience, and advanced capture APIs from the Windows Phone Runtime. This release also includes enhancements for working with photos.

Lenses

In Windows Phone 8, you can create a camera app called a lens that appears in the Windows Phone built-in camera app. A lens gives the user a consistent entry point into the viewfinder of your app. The lens feature is a type of extensibility available to apps that provide unique camera functionality via the camera APIs. As a lens, your app provides the user with a viewfinder experience and interacts directly with the camera. For more info, seeLenses for Windows Phone 8.

Working with photos

New extension methods have been added for the Picture class, including GetPreviewImage and GetPath. UseGetPreviewImage to help improve performance for displaying photos on the screen. This method returns photos in a resolution—WVGA, WXGA, or 720p—that is optimized for the user’s phone. The GetPath method returns the full path of the image in the media library; you can use this path to uniquely identify a photo. To use these methods, add a directive to Microsoft.Xna.Framework.Media.PhoneExtensions.

A new Launcher has been added, ShareMediaTask. Through the ShareMediaTask class, your app can directly access the share picker, so users can share photos like they do using the built-in photo viewer. For more info, seeHow to use the share media task for Windows Phone.

In addition, the PhotoChooserTask task now returns a more user-friendly file name. In the event handler, theOriginalFileName property returns the actual file name of the photo. For more info, see How to use the photo chooser task for Windows Phone.

Photo extensibility

Windows Phone 8 introduces new ways to extend the photos experience in Windows Phone. In addition to extending the Photos Hub, the photo apps picker, and the share picker, your app can now integrate with the photo edit picker or register as a rich media editor. For more info, see Photo extensibility for Windows Phone.

Auto upload

In Windows Phone 8, your app can automatically upload photos to a photo storage service using a resource-intensive background agent. By registering your app as an auto-upload app, your background agent can run without expiration. For more info, see Auto-upload apps for Windows Phone 8.

Advanced capture APIs

For apps that require fine control of the camera, the Windows Phone Runtime includes advanced capture APIs from the Windows.Phone.Media.Capture namespace. Use theWindows.Phone.Media.Capture.PhotoCaptureDevice class to control photo properties such as ISO, white balance, and exposure. You can even programmatically adjust the focus position. TheWindows.Phone.Media.Capture.AudioVideoCaptureDevice class offers a similar level of control for video and audio recording. For more info about advanced capture APIs, see Capturing photos for Windows Phone andCapturing video for Windows Phone.

In addition to those APIs, Windows Phone 8 provides a set of interfaces exclusively for native code. These interfaces provide access to uncompressed photo data and encoded audio/video samples. There also is a method you can use to fill a Direct3D 2-D texture with the current preview frame. For more info, see Camera APIs for native code (Windows Phone 8).

 

Music media library

In Windows Phone 8 you can add and remove music files from the user’s music collection with the SaveSongand Delete methods that extend the MediaLibrary class. This new API is in the Microsoft.Xna.Framework.Media.PhoneExtensions namespace in the assembly Microsoft.Xna.Framework.MediaLibraryExtensions.dll.

Pictures media library

In Windows Phone 8, for each picture saved on the phone, the following two thumbnail images are automatically created and can be retrieved by your apps.

  • A small thumbnail image. You can retrieve this thumbnail with the GetThumbnail method of the Pictureclass.

  • A preview image that has the same dimensions as the phone's screen. You can retrieve this preview image with the new GetPreviewImage extension method of the Picture class.

You can get the path to a picture with the new GetPath extension method of the Picture class. Use this method to provide a value for the FilePath property of the ShareMediaTask when the user wants to share a picture.

This new API is found in the Microsoft.Xna.Framework.Media.PhoneExtensions namespace in the assembly Microsoft.Xna.Framework.MediaLibraryExtensions.dll.

Background audio

In Windows Phone 8, you can capture info about the state transition from the PlayStateChangedEventArgs when the state of the BackgroundAudioPlayer changes. You can determine both the CurrentPlayState and theIntermediatePlayState that occurred before the audio player entered the current play state.

Here are some examples of the state transitions that you can handle with the info provided by the new event arguments:

For more info about background audio, see Background audio overview for Windows Phone.

 

Controls

Windows Phone 8 features the following new controls:

  • Windows Phone 8 includes a LongListSelector control that you can use to group, display, and scroll through long lists of data. It also provides a mechanism for users to jump to a specific section of a list.

  • In Windows Phone 8, Pivot and Panorama controls have been removed from the SDK and are now located in the phone’s read-only memory (ROM). This way your app can use a separate native input thread, which means a significant increase in the input responsiveness of these controls. The working set memory of thePanorama control also has been reduced.

  • The WebBrowser control is now based on Internet Explorer 10, which offers HTML5 and expanded CSS support for richer in-browser experiences.

  • The performance of the ProgressBar control has been improved. You should use this control to report value-based or indeterminate progress.

Launchers

You can use Launchers in your Windows Phone 8 app to help a user perform common tasks. The following Launchers are new in Windows Phone 8.

For more info about new Launchers in Windows Phone 8, see Launchers for Windows Phone.

 

VoIP

With Windows Phone 8, you can create Voice over IP (VoIP) apps that allow users to make audio and video calls over their data connection. VoIP apps are integrated into the built-in phone experience so that, for example, incoming calls are displayed using the same phone UI as regular cellular calls. For more information, see VoIP apps for Windows Phone 8.

Bluetooth

Bluetooth is a wireless communication technology that devices within a 10-meter proximity can use to communicate with each other. You can use new Bluetooth API introduced in Windows Phone 8 to create apps that communicate with other phones using Bluetooth technology. Core Bluetooth scenarios for Windows Phone 8 include app-to-app and app-to-device communication, and open up a wide range of possibilities you can use to make your app more connected. For more info, see Bluetooth for Windows Phone 8.

Proximity

Windows Phone 8 introduces a new API, the Proximity API that you can use to create apps that do the following:

  • Send data between devices using NFC.

  • Use a phone to interact with NFC tags.

  • Establish a Wi-Fi or Bluetooth connection between your app and an instance of your app on a proximate device.

On two phones that each have a Near-Field Communication (NFC) chip, app users can perform these scenarios simply by tapping their phones together.

For more info about Proximity, see Proximity for Windows Phone 8. Proximity on Windows Phone 8 also enables app-to-app connection using Bluetooth technology. For more info about Bluetooth for Windows Phone 8, seeBluetooth for Windows Phone 8.

Incoming sockets

Windows Phone 8 introduces the enhancements to incoming sockets. System.Net.Sockets andWindows.Networking.Sockets both support incoming sockets, which means your app can listen for an incoming network connection, and then bind to that connection.

Support for IPv6

Support for the 128-bit addressing system for devices on a network has been added to System.Net.Sockets, and also is supported in Windows.Networking.Sockets.

Windows.Net.Networking

The Windows Runtime API, Windows.Networking.Sockets, has been adopted for Windows Phone 8. It has been implemented as a Windows Phone Runtime API, making it easy to use in whatever supported programming language you choose. Although we've enhanced the .NET API, System.Net.Sockets, to support more features such as IPv6 and listener sockets, you should consider using the new API for sockets programming because it is more portable than the .NET API. Windows.Networking.Sockets has been built from the ground up to be clean, secure, and easy-to-use APIs that enforce best practices. For more info about supported Windows Runtime API, seeWindows Phone Runtime API.

Winsock native API support

 

Winsock native APIs are supported in Windows Phone 8. One key advantage of using Winsock APIs is that you can reuse the custom networking functionality that you’ve already implemented using Winsock, so it’s easier for you to create your app on the Windows Phone OS 8.0 platform. For more info about Winsock native API support, see Supported Win32 APIs for Windows Phone 8.

Data sense

Windows Phone 8 introduces the new Data Sense feature which you can use to help your app users save money by staying within the limits of their data plans. In the Data Sense feature, a user can specify the limits of their data plans, and then Data Sense monitors data usage in relation to these limits. With this info, an app can help users save money by reducing data usage when the user is close to their data limit, or by discontinuing data usage when the user is over their data limit.

For more info about Data Sense in Windows Phone 8, see How to adjust data usage using the Data Sense API for Windows Phone 8.

 

Storage

Windows Phone 8 aligns with Windows 8 to support a subset of storage APIs from the Windows Runtime and Win32. This release also introduces the Microsoft.Phone.Storage namespace, a new .NET API for reading from an SD card. For more info, see Data for Windows Phone and Reading from the SD card on Windows Phone 8.

Custom contact store

You can design your Windows Phone 8 app to create a set of contacts that are owned exclusively by the app, but which are visible through the built-in phone experience. APIs are provided to create, update, delete, and query the app’s contacts, as well as to sync the app’s contact list with a remote list maintained by the app’s cloud service. For more info, see Custom contact store for Windows Phone.

File and URI associations

You can use file and URI associations in Windows Phone 8 to automatically launch your app when another app launches a particular file type or URI scheme. For example, a file association allows your app to launch to handle an email attachment. You can also use the association-launching API to launch another app based on a specific file type or URI scheme. For more info, see Auto-launching apps using file and URI associations for Windows Phone 8.

Search extensibility

When you extend the Search experience in Windows Phone 8, quick cards pass more info to your app. There is also a new quick card for events, the event card. These changes are summarized in the following table.

 

Quick card

New URI parameters

Place Card

PhoneNumber

Movie Card

ReleaseDate

Event Card (new quick card)

EventNameStartDatePlaceNamePlaceLatitudePlaceLongitude,PlaceAddress

 

For more info about these parameters, see Search extensibility for Windows Phone.

 

In-app purchase

In-app purchasing gives developers the ability to create apps or games that sell virtual products for real money. Microsoft servers host the catalog products that are available for in-app purchasing, including price and descriptive metadata. Microsoft also provides a commerce infrastructure, including methods for users to pay in 190 regions around the world.

For each product that users can purchases through in-app purchasing, a developer enters a description in Windows Phone Dev Center, in addition to prices for each region where users can make the in-app purchase. Using the APIs in Windows Phone 8, a developer can list, within an app, the products that are available for users to purchase in that app. Developers don’t need to write special code for handling different types of purchase instruments. All purchase methods that users can use to purchase apps and games are supported for in-app purchasing. The app or game must host and deliver any content associated with the in-app product. For more info, see In-app purchase for Windows Phone 8.

Windows Phone 8 makes it easy to build and deploy apps to phones enrolled in your enterprise. For info about the process of enrolling phones in your enterprise and deploying apps to them, see Company app distribution for Windows Phone 8.

In Windows Phone 8 you can create apps that read from right to left, and apps that use bidirectional languages. For more info about using new localization and globalization features in Windows Phone 8, see Creating bidirectional apps for Windows Phone 8.

You now have the ability to define a default culture for an app domain. For more info, see the CultureInfo class.

New capabilities have been added to the app manifest file to support new features such as Bluetooth and Near-Field Communication (NFC). You can also specify the hardware required by your app using the requirements section to help ensure that the app is downloaded and installed by users with phones that can successfully run the app. For more info about the new capabilities and hardware requirements in Windows Phone 8, see App capabilities and hardware requirements for Windows Phone.

In addition, editing the manifest file is now much easier using the Manifest Editor tool that is built-in in Visual Studio. For more info about how to edit the app manifest file, see How to modify the app manifest file for Windows Phone.

Windows Phone 8 introduces some APIs that work differently than the same APIs work in a Windows Phone OS 7.1 app. For details about these differences and how they affect you as you prepare to develop your app, seeApp platform compatibility for Windows Phone.

In many cases where an API behaves differently in Windows Phone 8 than it does in Windows Phone, the API is quirked. That is, for apps that target Windows Phone OS 7.1, the API automatically behaves as it did in Windows Phone OS 7.1. For apps that target Windows Phone 8, the API has a new behavior. For more info, see the "Quirks mode behavior in the .NET Framework" section in App platform compatibility for Windows Phone.

The common language runtime in Windows Phone 8 offers the following new features and differs from Windows Phone in the following areas:

Code generation

  • Windows Phone 8 uses a new strategy of compiling apps in the cloud for enhanced startup performance. To ensure that developers are able to execute their app as it would run on an app user’s device, the appropriate tools have been provided as part of Windows Phone SDK 8.0.

  • Inlining support in Windows Phone 8 is improved; manually inlining code is no longer necessary.

  • Code generation by the JIT compiler has been optimized.

Threading

  • The .NET Framework is multi-core aware. Apps can create threads, use the ThreadPool class, the Task Parallel Library, and all the synchronization primitives to leverage multiple cores.

  • Support for multiple cores may cause APIs like Thread.Sleep to behave differently.

Security model

  • The managed sandbox has been removed. As a result, a security exception, such as aMethodAccessException, that was expected in Windows Phone OS 7.1 may not be thrown in Windows Phone 8.

Garbage collection

  • The garbage collection heap in Windows Phone 8 has two generations, not three generations as it does in Windows Phone OS 7.1.

  • In Windows Phone 8, the garbage collector has a large object heap (LOH).

  • Background garbage collection is not available in Windows Phone 8.

  • The phone's resource manager invokes a garbage collection when an app approaches the memory cap and will terminate the app if it exceeds the memory cap.

  • The runtime's auto-tuned garbage collection triggers can be impacted by an app's forced garbage collections.

  • In Windows Phone 8, the performance of per-thread allocation by the garbage collector is improved.

Portable Class Libraries

  • The Portable Class Library project in Visual Studio 2012 gives you the ability to write and build managed assemblies that work on multiple .NET Framework platforms. Using a Portable Class Library project, you choose the platforms (such as Windows Phone 8 and .NET for Windows Store apps) to target. The available types and members in your project are automatically restricted to the common types and members across these platforms.

  • Portable class libraries that target Windows Phone OS 7.1 and Windows Phone 8 can be used on Windows Phone 8. Note that a portable class library that targets Windows Phone OS 7.1 but runs on Windows Phone 8, runs as a Windows Phone 8 app. For more info, see Cross-Platform Development with the .NET Framework.

Interop

  • Apps can invoke first-party Windows Runtime APIs from managed code.

  • COM interop and P/Invoke are not supported.

General performance

  • In Windows Phone 8, the performance of asynchronous and parallel operations that use types in theSystem.Threading.Tasks namespace has been improved. In addition, the stream classes now include asynchronous methods to take advantage of the asynchronous features added to the C# and Visual Basic languages. For more info, see Asynchronous File I/O in the .NET Framework Version 4.5 documentation.

  • The performance of virtual calls in Windows Phone 8 has been improved.

  • The implementation of Fast Application Switching is improved in Windows Phone 8. When a switch from the active application occurs, its managed execution is paused. Once an application is paused, the common language runtime guarantees 0 CPU utilization, and all of the application's timeouts are virtualized.

posted @ 2012-11-05 14:45  J默  阅读(1106)  评论(7编辑  收藏  举报