Compartilhar via


Unsupported APIs for background agents for Windows Phone 8

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

There is a set of APIs that cannot be used in code executed by a Scheduled Task. This includes code contained in classes that implement ScheduledTaskAgent as code in any libraries that are called from a ScheduledTaskAgent. Some of these APIs are detected by the development tools and will raise an error at run or compile time. Other APIs are restricted by the Store application submission process.

This topic contains the following sections.

Unsupported APIs

The following table lists the APIs in each namespace that are not supported for Scheduled Tasks. For some namespaces, all of the APIs within the namespace are unsupported.

Namespace

Unsupported API

Microsoft.Devices

Camera

Microsoft.Devices

VibrateController

Microsoft.Devices

NowPlaying

Microsoft.Devices.Radio

All APIs in this namespace are unsupported.

Microsoft.Devices.Sensors

All APIs in this namespace are unsupported.

Microsoft.Phone.BackgroundAudio

BackgroundAudioPlayer

Microsoft.Phone.BackgroundTransfer

Add(BackgroundTransferRequest)

Microsoft.Phone.Controls

WebBrowser

Microsoft.Phone.Info

IsKeyboardDeployed

Microsoft.Phone.Notification

All APIs in this namespace are unsupported.

Microsoft.Phone.Scheduler

Add(ScheduledAction)

Remove(String)

Replace(ScheduledAction)

Microsoft.Phone.Shell

All APIs are unsupported except the following:

Microsoft.Phone.Tasks

All APIs in this namespace are unsupported.

Microsoft.Xna.*

On Windows Phone 8, all APIs in all XNA Framework namespaces are unsupported except the following:

On Windows Phone versions before Windows Phone 8, all XNA Framework namespaces are unsupported.

System.Windows

MessageBox

System.Windows

Clipboard

System.Windows.Controls

MediaElement

System.Windows.Controls

MultiScaleImage

System.Windows.Media

LicenseAcquirer

System.Windows.Media

A/V Capture

System.Windows.Navigation

All APIs in this namespace are unsupported.

Noteworthy APIs for Use with Scheduled Tasks

GeoCoordinateWatcher

This API, used for obtaining the geographic coordinates of the device, is supported for use in background agents, but it uses a cached location value instead of real-time data. The cached location value is updated by the device every 15 minutes.

Mutex class

The Mutex class should be used to synchronize access to resources that are shared between the foreground application and the background agent, such as files in isolated storage.

ShellToast class

This class can be used to pop up a toast notification from a running background agent.

Update(ShellTileData) method of the ShellTile class

Delete()()() method of the ShellTile class

ActiveTiles property of the ShellTile class

These methods can be used to modify shell Tiles from a running background agent. Note that shell Tiles cannot be created in a background agent.

HttpWebRequest class

This class allows you to make web requests from a running background agent.