Capabilities are an easy way for the user to know about the resources / functionalities that an app can utilize and then decide to download the app . Some of these include camera access, geographic location data etc .
When a new Windows Phone project is created , by default , all the capabilities are included by default in the WMAppManifest.xml file .
These Capabilities include
- ID_CAP_GAMERSERVICES – This is needed if the Windows Phone App interacts with the XBox Live.
- ID_CAP_IDENTITY_DEVICE – This is needed if the Windows Phone App retreives unique Device ID or other unique device information.
- ID_CAP_IDENTITY_USER – This is needed if the Windows Phone app retreives the anonymous LiveID of the user for identifying the user.
- ID_CAP_LOCATION – This is needed if the Windows Phone app utilizes Geographic location services.
- ID_CAP_MEDIALIB – This is required of the Windows Phone app accessess the phone’s media library.
- ID_CAP_MICROPHONE – This is needed for the Windows Phone app that uses the microphone.
- ID_CAP_NETWORKING – This is needed if the Windows Phone app utilizes the data connection.
- ID_CAP_PUSH_NOTIFICATION – This is needed if the Windows Phone app uses push notifications.
- ID_CAP_SENSORS – Required for the apps that utilizes sensors like accelerometer , gyroscope , compass etc.
- ID_CAP_WEBBROWSERCOMPONENT – This is needed if the Windows Phone app uses WebBrowser control.
- ID_CAP_ISV_CAMERA – This is needed if the Windows Phone app uses the device’s camera.
- ID_CAP_CONTACTS – This is needed if the Windows Phone app uses the Contacts class for searching the users.
- ID_CAP_APPOINTMENTS – This is needed if the Windows Phone app uses the Appointments class to search appointments.
Below is a sample WMAppManifest.xml file
<?xml version="1.0" encoding="utf-8"?> <Deployment xmlns="http://schemas.microsoft.com/windowsphone/2009/deployment" AppPlatformVersion="7.1"> <App xmlns="" ProductID="{28dcb0f4-93d3-459b-841b-b1a78e9dae09}" Title="PhoneApp4" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="PhoneApp4 author" Description="Sample description" Publisher="PhoneApp4"> <IconPath IsRelative="true" IsResource="false">ApplicationIcon.png</IconPath> <Capabilities> <Capability Name="ID_CAP_GAMERSERVICES"/> <Capability Name="ID_CAP_IDENTITY_DEVICE"/> <Capability Name="ID_CAP_IDENTITY_USER"/> <Capability Name="ID_CAP_LOCATION"/> <Capability Name="ID_CAP_MEDIALIB"/> <Capability Name="ID_CAP_MICROPHONE"/> <Capability Name="ID_CAP_NETWORKING"/> <Capability Name="ID_CAP_PHONEDIALER"/> <Capability Name="ID_CAP_PUSH_NOTIFICATION"/> <Capability Name="ID_CAP_SENSORS"/> <Capability Name="ID_CAP_WEBBROWSERCOMPONENT"/> <Capability Name="ID_CAP_ISV_CAMERA"/> <Capability Name="ID_CAP_CONTACTS"/> <Capability Name="ID_CAP_APPOINTMENTS"/> </Capabilities> <Tasks> <DefaultTask Name ="_default" NavigationPage="MainPage.xaml"/> </Tasks> <Tokens> <PrimaryToken TokenID="PhoneApp4Token" TaskName="_default"> <TemplateType5> <BackgroundImageURI IsRelative="true" IsResource="false">Background.png</BackgroundImageURI> <Count>0</Count> <Title>PhoneApp4</Title> </TemplateType5> </PrimaryToken> </Tokens> </App> </Deployment>