How to enable device capabilities

1 out of 2 rated this helpful - Rate this topic

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.

  1. In Visual Studio, open the app manifest.
  2. Open the Capabilities tab. Here is a screen shot of the Capabilities tab, with some device capabilities selected: Capabilities Tab
  3. Select the device capabilities that your app uses. This table describes all the device capabilities:
    Device CapabilityDescription
    LocationProvides access to the current location. This is obtained from dedicated hardware like a GPS sensor in the PC, or derived from available network information.
    MicrophoneProvides access to the microphone's audio feed. This allows the app to record from connected microphones.
    ProximityProvides 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 StorageProvides 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 MessagingProvides 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.

    WebcamProvides 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 CapabilityAPI
Location

See Detecting geolocation for tutorials.

Microphone

See Adding Multimedia to your app for tutorials.

ProximitySee Supporting proximity and tapping for tutorials.
Removable Storage

See Accessing Content on Removable Storage for tutorials.

Text MessagingUse 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

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.