This tutorial describes how to declare device capabilities in Microsoft Visual Studio 2012. This enables your app to use cameras, microphones, location sensors, removable storage and near-field proximity.
What you need to know
Technologies
- Windows Runtime
Prerequisites
- Visual Studio 2012
Instructions
Step 1: Specify the devices your application will use.
Windows Store apps require you to specify in the app manifest when you use certain types of devices.
- In Visual Studio, open the app manifest.
- Open the Capabilities tab. Here is a screen shot of the Capabilities tab, with some device capabilities selected:

- Select the device capabilities that your app uses. This table describes all the device capabilities:
Device Capability Description Location Provides access to the current location. This is obtained from dedicated hardware like a GPS sensor in the PC, or derived from available network information. Microphone Provides access to the microphone's audio feed. This allows the app to record from connected microphones. Proximity Provides the capability to connect to devices in close proximity to the PC via near-field communication (NFC). Near-field proximity may be used to send files or communicate with an app on the nearby device. Removable Storage Provides the ability to add, change, or delete files on removable storage devices. The app can only access file types on removable storage that are defined in the manifest by using the File Type Associations declaration. The app can't access removable storage on HomeGroup PCs. Text Messaging Provides access to the PC's text messaging functionality. This allows the app to send and receive text messages. Note This functionality is only available to mobile operator apps and Windows Store apps given privileged access by mobile network operators. For more information see http://msdn.microsoft.com/en-us/library/windows/hardware/hh852368.aspx.
Webcam Provides access to the webcam's video feed. This allows the app to capture snapshots and movies from connected webcams.
Step 2: Use the Windows Runtime API for communicating with your device
The following table lists the Windows Runtime APIs to use with each device capability.
| Device Capability | API |
|---|---|
| Location |
See Detecting geolocation for tutorials. |
| Microphone |
See Adding Multimedia to your app for tutorials. |
| Proximity | See Supporting proximity and tapping for tutorials. |
| Removable Storage |
See Accessing Content on Removable Storage for tutorials. |
| Text Messaging | Use the Windows.Devices.Sms API. Note This functionality is only available to mobile operator apps and Windows Store apps given privileged access by mobile network operators. For more information see http://msdn.microsoft.com/en-us/library/windows/hardware/hh852368.aspx. |
| Webcam |
See Adding Multimedia to your app for tutorials. |
Remarks
Note that some types of devices, such as printers and sensors, don't need to be declared in the app manifest.
Build date: 10/30/2012