- Understanding the Role of XAP Files
- The Windows Phone Capabilities Model
- The Threading Model for XAML-Based Graphics and Animation in Windows Phone
- Understanding the Frame Rate Counter
- The Windows Phone Application Analysis Tool
- Reading Device Information
- Applying the Model-View-ViewModel Pattern to a Windows Phone App
- Property Change Notification
- Using Commands
- Argument Validation
- A Platform-Agnostic Dialog Service
- Consuming Local Web Applications
- Summary
The Windows Phone Capabilities Model
Microsoft recognizes that making the user experience on the phone the best it can be helps to secure greater adoption of the platform. To this end, users should never regret installing an app, and one way to ensure this is by using a security model that requires users to opt-in to certain functionality within the app, called capabilities.
A capability is a phone resource that when used by your app may bring with it privacy or security concerns, or it may incur a cost that the user should be made aware of. Examples of capabilities include the camera, geographic location services, microphone, and SMS.
Capabilities are a way of disclosing to the user what an app is potentially able to do. Your app’s capabilities are displayed to potential users, those considering downloading the app from the Windows Phone Marketplace. It is at the user’s discretion whether to download your app; if a user does not want an app to have access to, for example, the phone’s camera, the user may decide not to download that app.
You define your app’s capabilities in its WMAppManifest.xml file. When a new Windows Phone application is created, a subset of the available capabilities is included by default in the manifest file. The Windows Phone operating system grants security permissions to the application according to the capabilities listed in the manifest file. See http://bit.ly/Pj2YgE for a list of these capabilities.
When an app is submitted to the Windows Phone Marketplace, the XAP file is decompressed, validated, and repackaged. During this process the security capabilities of the app are discovered and written back to the WMAppManifest.xml file. As a result, if the manifest does not contain capabilities that are used by your app, these capabilities are inserted as part of the submission process.
Determining App Capabilities Using the Marketplace Test Kit
The Windows Phone SDK includes a tool for analyzing the capabilities required by your app. To analyze your app’s capability requirements, perform the following steps:
- Build the app using a Release configuration.
- Right-click the Windows Phone app project’s node in the Visual Studio Solution Explorer and select Open Store Test Kit (see Figure 2.2).
FIGURE 2.2. Store Test Kit.
- Click the Run Tests button to begin the analysis process.
The Marketplace Test Kit offers numerous tests that can assist you in ensuring that your app is Marketplace ready. It can also save you time and the frustration caused by failing the Marketplace submission requirements.