Windows Phone network connection Policy

Source: Internet
Author: User
Preface

In the meager content, "someone" (I remember who it was, ^ _ ^) asked Windows Phone whether to continue to connect to wifi under the screen lock, which caused a lot of WP micro-controller discussions, in fact, I didn't care about this problem because it is uncontrollable, but there are too many people discussing it. So I want to talk about my thoughts on the network connection policy of Windows Phone.

Problem definition

This problem can be simply redefinedWhether the Windows Phone is connected to the network when it is idle (idle.Which connection method is used depends on the Windows Phone policy, which basically considers factors such as battery usage and connection cost ($.

Multi-task dream

If someone thinks that Windows Phone is a single task and will kill all apps when locking the screen, then he/she may be fooled by the water supply army, windows Phone is a multi-task operating system from the first day. Therefore, when the screen is locked, keep the network connection and continue to complete background tasks.Possible. However, Microsoft generally does not do this and restricts app developers to do so to provide a better user experience.

Is the link or is disconnected?

My answer is yes and no. In the case of Windows Phone screen lock, it cannot be answered simply because the operation is determined based on the policy. These policies aim to provide a better user experience. For a simple policy, refer to the following formula:

Task Type + power status = disconnected

According to the previous definition, the formula can be replaced:

Task Type + power status + available network connection media (WiFi/3G) = network connection

That is to say, in different cases, Windows Phone will maintain or disconnect the connection accordingly. This is also the most basic function of the modern smart phone system (WP, Android, IOS. Modern smart phone systems are generally composedSystemFor power management and network connection management. Please note that I have added the emphasis on the "System", because the non-modern smart phone system may have handed over the initiative to the application (APP) (Of course, the final Operating System reserves the highest authority). For example, in the past, Windows Mobile decided to enable and disable network connections, and to enable 3G or WiFi, how can an app developer shoulder the responsibility of the OS developer? There are too many situations to consider. For example, when the Symbian app is started, it will prompt "whether to enable the network connection, whether to enable 3G or WiFi" and push the link responsibility to the user. These old systems have greatly damaged the user experience.

------------------------- It seems reasonable to run the question -------------------------------------------------------------------------------------

The following is an agile example to discuss what users need:

The most non-technical user, if I want to see meager, then open the meager app.

HereNon-technical usersI don't care about the connection status of the mobile phone at all. What I care about isWhether it can be viewed and exposed.

Here, the user story has the following additional terms (Acceptance Criteria ):

1. If you can get in touch with the Service (there is no link here, it actually means this, connect) to the meager background service, directly open the app and display the response page, for example, "@ me"

2. If you are unable to access the meager background service and there is no cache, the system prompts you that there is no network link. Please try again later.

3. If you cannot access the meager backend service and there is a cache, you are prompted to view the cache only.

A feature of this user story is that it is not determined by the user, but a predetermined action,ForceThe user chooses or accepts it, but pretends to respect the user's appearance.Back to jobs, the best choice for the user is not to select him.

------------------------- Run back to the topic ------------------------------------------------------------------------------------

From this, we can know that none of the issues concerned with this kind of problem is"Non-technical users", Yes, I mean you, 0 _ ^. In fact, Windows Phone has taken the initiative to manage network links and is managed by the system in a unified manner. As an app developer, it is not necessary to check the root cause of the problem and write excellent results.ProgramBut if you really want to know, I will try my best to discuss it below.

When Will Windows Phone be idle?

The network connection policy is mentioned above. Therefore, if the developed app meets these policies, the network connection will also be performed in idle state. I try to list all possible situations:

Applicationidledetectionmode is set to Disabled

For Windows Phone apps, you can modify the applicationidledetectionmode of phoneapplicationservice to force the app to be unlocked when the screen is locked (note that this function is sometimes used after mango is released). This type of program is generally a navigation program, the Music Playing Program (there is an alternative after mango, which will be described later), that is, the mobile phone screen lock, the app continues to run, the program can continue to do some network requests, in this way, the WiFi Link will be maintained (if there is a WiFi Link ). However, according to Microsoft documentsShouldStop/close many operations, such as timer, animation, accelerometer, location service, FM radio, and network disconnection. But note that I have used it here. It is not required. Therefore, the app can continue to make network requests.

Background audio

The app that uses audioplayeragent (background audio playback) can continue playing when the screen is locked. If the audio URL is specified as the URL of the network, in order to play normally, windows Phone continues to maintain WiFi connections if WiFi is available.

Background file transfers

If the app uses backgroundtransferservice, the program keeps the Link under certain circumstances and continues to download the app. If the file is smaller than 20 mb, Windows Phone continues to use 3G for download, if the file is less than 100 MB, Windows Phone will continue to use wifi to download files. If the file is larger than MB, Windows Phone will start download only when the external power supply and China Unicom WiFi are required.

Background agents

If the app uses scheduledtask (scheduled task), the program starts to execute it at intervals. There may be two different tasks as follows:

Periodictask is executed every 30 minutes and can be executed for only 25 seconds at a time.

Resourceintensivetask (resource-consuming task) is executed every 10 minutes, but an external power supply needs to be connected.

The two tasks can be linked to the network during execution to request network resources.

Schedule Tile

If the app uses shelltileschedule (information block update task), the program can update live tile at intervals. If the image of the tile is on the network, the network link is started.

Tile notification

The official website does not describe the implementation details of the push task. Generally, the implementation methods are as follows:

1. trigger a mobile phone request via SMS.

2. Mobile phone timed pull (pull) information.

Either way, the mobile phone eventually needs to obtain the PUSH Service information through the network link, so it may also use the network link.

Summary

In either case, Microsoft tries to provide a good user experience (including power consumption, reflection speed, and communication fees). Therefore, as an app developer, what we need to do is to provide a better user experience under the existing restrictions, and there is no need to disrupt the user experience for long data links.

If you have any questions, please leave a message, or Weibo me @ Lin Yongjian. Thank you!

Ad Time

The annual Melbourne Cup is coming again. It's time to watch the beautiful girls. Let's get down with the Free Melbourne Cup app.

Http: // http://windowsphone.com/s? Appid = 8801c39f-519c-48a1-a21a-2585ddb851d4


 

Http: // http://windowsphone.com/s? Appid = 8801c39f-519c-48a1-a21a-2585ddb851d4

All suggestions are welcomed. Thank you!

Related Article

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.