Designers and developers can take advantage of several of the mobile device capabilities in their Windows Phone 7 applications, both to extend the functionality for users and to incorporate features that are particularly useful within the scenario of using a mobile device. The following are typical scenarios for the device capabilities of Windows Phone 7:
- Using the Location Service to determine the location of the user. This information may be useful, and it could be included in the data submitted to a server by an application when required. Alternatively, it may be used to display a map on the phone that is centered on the current location.
- Using the extended device information capabilities to get information about the device, manage the memory used by the application, and maximize its performance.
- Using the accelerometer to detect short bursts of motion of the device in order to implement functions commonly associated with certain types of motion. For example, shaking the device vigorously could cancel a partly completed process and allow the user to restart it.
- Using the touch detection capabilities to capture gestures such as hold, drag, pinch, and flick. For example, a hold gesture might, after a specified delay, bring up a screen containing extra information, while a flick gesture might scroll a list.
- Using the camera to capture data or other relevant information in the form of an image to be included in the data submitted to a server or stored on the device. For example, capturing a barcode could initiate a web search for that specific product.
- Using the sound recording feature to record voice from the phone’s microphone. For example, allowing users to submit data in an audio format or include recorded sound clips in their responses sent to a server.
- Using the media features of the device to stream information that is useful to users as they use an application. For example, a user may be able to access audio files that contain help on using the application, or sounds and pictures could be part of the application experience.
- Using the contacts and messaging features to integrate the application with the user’s lists of contacts, and to invoke phone and messaging features. For example, the application could prompt users to add useful contacts, including the appropriate email address and phone number, to the list of contacts stored on their phone. It might also invoke the messaging features to make it easy for the user to dial a number such as the customer support department, create a new email message with a specified subject and body text, or create an SMS (text) message.
- Using the vibration capability to alert users of events occurring in the application. For example, the application could alert users that new data is available, or that an asynchronous delivery of data has completed.
- Invoking the web browser to display a specified web page. This might be useful for providing additional content or advice to the user, or for allowing the user to access specific pages on your own website.
- Invoking the search feature with a specified search string. This could be useful to help users more easily search for specific information related to the application they are using.
- Invoking the Windows Marketplace hub and showing a specific application that the user can download and install. For example, you might use this feature to highlight new versions of the application.
- The following sections describe the basic usage of the device capabilities available in Windows Phone 7.