Windows Phone 7

Source: Internet
Author: User

I recently learned how to develop Windows Phone 7, so I was afraid to forget to copy something.

1. WP7 architecture: the WP7 architecture is based on Microsoft's. NET platform. In terms of application architecture, sliverlight and xNa work together to develop applications using sliverlight.Program, Using xNa to develop games

WP7 uses a subset of. NET and a class library of sliverlight and xNa.

2. Windows Phone 7 Lifecycle

Windows Phone is a multitasking operating system, but does not support multithreading, so I think it should be a fake multitasking.

It only has one third-party application that can run on the frontend. When the user leaves the page of the current program, the application will be terminated by the operating system.

Screen lock incoming call short message reminder function low power program switching users clicking the start button may cause application interruption

Tombstoning tombstone freezing is a major feature of the life cycle of WP7.

The deactivated state (terminated) re-activated state (activated) running state (running)

Lifecycle Processing Event application_launching when the program is started, call the program re-activation without calling it. Usually some permanent configuration data (persisted data) is loaded from isolated storage)

Application_closing is called when the program is closed. When the program is disabled, it is not called. Usually, some permanent configuration data (persisted data) is saved to isolated storage.

Application_activated is called when the program is re-activated. When the program is started, it is not called. Generally, phoneapplicationservice. State is used to save some temporary data (transient data)

Application_demo-vated is called when the program is not activated. When the program is closed, it is not called normally from phoneapplicationservice. state to read some temporary data (transient data) to restore the status when the user leaves the page, to maintain user experience consistency.

Note the following terms in WP7:

    • Tombstoing: the state in which the program is disabled when it is navigating out. The state of the program retained by the system.
    • Page state: the visual state of the program. Add events in onnavigatedto and onnavigatedfrom.
    • Application State: the program does not have the status of a specific page. It is called using the phoneapplicationservice class.
    • Persitent data: the data enjoyed by all instances in the program. Generally, isolated storage is used for storage.
    • Transient State: Describes the powerful data in the program, which is generally stored in the state Dictionary data provided by phoneapplicationservice.

WP7 provides two methods to obtain data: isoloated storage and state. The former can store data for a long time, while the latter can only obtain data without eliminating your state in the memory.

In WP7, if an application is not loaded in 10 seconds, it will be forcibly disabled by the system.

3. launchers and Selector)

Windows Phone applications cannot directly access other storage information, such as contact information.

Windows Phone applications cannot directly call other functions, such as phones and short messages.

The initiator and Selector provide applications with indirect access to these built-in functions, and the operating system may terminate the current application when the initiator and Selector are running.

Starter: Start a built-in program and provide it to the user without returning any data to the called program.

Selector: Start a built-in program to provide users with the data returned to the called program. When the user completes the operation, the call to support blood will be re-activated and the returned data will be received, but the user may cancel the operation so that null is returned.

Built-in starter emailcomposetask marketplacedetailtask marketplacehubtask marketplacereviewtask marketplacesearchtask mediaplayerlauncher phonecalltask searchtask smscomposetask webbrowsertask

Built-in selector cameracapturetask emailaddresschoosertask phonenumberchoosertask photochoosertask saveemailaddresstask savephonenumbertask

There may be no tombstone tasks photochoosertask cameracapturetask mediaplayerlauncher emailaddresschoosertask phonenumberchoosertask phonecalltask (neither deactived event is called)

 

4. Push Notification Service

The Windows Phone execution model determines that only one third-party application can run third-party applications in the background. The third-party applications cannot pull data to the cloud in the background. Microsoft provides the push notification service to third-party applications for update notifications. the active communication initiated by the message server can effectively reduce battery consumption.

The current version of Windows Phone only supports a maximum of 15 third-party applications to use the push notification service.

The message types include:

Raw notification can be used to send data applications in any format. You can process notification messages related to data applications as needed. Only notifications sent when the application is running

The data sent by toast notification is in the specified XML format. If the application is running and the content is sent to the application, if the application is not running, a message is displayed in the toast message box.

Data sent by tile notification is not sent to the application in the specified XML format. If the user's application pin is the same as start,

The updated data is sent to the title of the Start Screen (including three attributes, the background, the title, and the counter. Each attribute has a fixed format and position, and the attributes can be used, it is not recommended to use three attributes together)

Push Service details andCodeHttp://www.lob.cn/jq/wp7/7491.shtml

5. location service)

Location service helps developers develop location-aware applications for Windows phones.

Location service can obtain location information from multiple data sources, such as GPS, Wi-Fi, and mobile network base stations.

Based on application requirements, location service calculates location information from one or more data

Effective balance of battery consumption and location information accuracy provides an event-driven unified interface for Applications

 

Try to reduce battery consumption

If possible, use the data source with lower accuracy

Enable the location service when necessary. Once the service is ready for use, it is immediately disabled.

Set the threshold of accuracy to reduce the update frequency.

Use the status update event (statuschanged) to monitor the service status and remind users to update the status.

Remind the user to wait for a period of time (15 seconds to 120 seconds) when starting the geographic location service for the first time)

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.