Apability, that is, capability. Windows Phone 7 has a much stricter security mechanism than the previous Windows Mobile platform. In many casesProgramTo do anything, you must declare it in advance to let the user know. This is capability.
Create a Silverlight for Windows Phone application project. A wmappmanifest. xml file is displayed under the properties directory of the project. It defines some configuration information about the program. Here, you will find a section similar:
<Capabilities> <capability name = "id_cap_gamerservices"/> <capability name = "id_cap_identity_device"/> <capability name = "capacity"/> <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 "/> </capabilities>
The capability of the program is stated here. The content stated here is displayed in the marketplace when the user installs the program (the marketplace in Zune on the PC side and the marketplace on the WP7 mobile phone ). For example, the following shows the game"The harvest"Information:
The information in the lower-right corner shows that the program needs to access the network, sensor, media library, and Xbox Live services. If you feel that a function may be potentially dangerous to you, you can refuse to install the software. For example, if you find a "Calculator" software that declares that you want to read your device or your personal identification information, this is obviously against common sense and you can refuse to install it. If the program does not identify a function,CodeIs it true? It is very simple. It will throw an "unauthorizedaccessexception" exception to protect users' rights and interests. Therefore, for the features you do not need to access in your program, do not forget to remove them from the <capabilities> section in the wmappmanifest. xml file. The following capability can be declared in the program:
- id_cap_networking: Network Access
- id_cap_identity_device: device information
- id_cap_identity_user: User's anonymous identity information
- id_cap_location: Location Information
- id_cap_sensors: Sensor
- id_cap_microphone: microphone for recording
- id_cap_medialib: access the media repository
- id_cap_gamerservices: Services of Xbox Live
- id_cap_phonedialer: Call
- id_cap_push_notification: Push messages
- id_cap_webbrowsercomponent: browser component