📜 ⬆️ ⬇️

Multitasking in Windows Phone 7 Series

One of the most controversial issues discussed when considering the Windows Phone 7 Series is multitasking, or rather its absence. As it turned out, this issue is of concern to a large number of users and developers. Let's take a closer look at this question. To do this, we turn to the implementation of multitasking in Windows Phone Classic (the old name - Windows Mobile 5.x, 6.x).

In Windows Phone Classic, multitasking has been fully implemented. This means that several applications can be executed at the same time without pausing. This is, in fact, some analogue of the desktop platform, where this process looks similar. However, let's think about it - is it really reasonable to use this approach for a mobile platform as well as for a desktop one?

Let's try to present a typical scenario of using mobile devices. Surely it will include the use of several applications alternately for a long amount of time. For example, at the moment I use several such applications: viewing photos, reading e-mail, reading Twitter feed, viewing current traffic, Windows Media Player, editing and viewing Microsoft Office documents, viewing PDF documents, calculator, etc. With prolonged use of the device, you can to discover that all or part of these applications are loaded in memory, while at the moment they are completely unnecessary, since there is no need to use them. However, at the moment they are actually loaded into memory and executed, load the CPU, take up memory and consume the battery. Of course, some of the users are closely monitoring that at the moment only the necessary applications have been downloaded, but not all of them do this. It is for this reason that the use of such an approach is not reasonable for a mobile platform.
')
In some mobile platforms there is another extreme - the ability to run only one application at a time. This approach is also not correct, since sometimes it is still necessary to run several applications simultaneously. A classic example is the use of a music player while using other applications, such as reading mail.

The developers of Windows Phone 7 Series decided not to resort to extremes and chose a middle ground. In Windows Phone 7 Series, only one running application can be executed at a time. At the same time, there is a set of system applications that can run “in the background.” When switching to the main window or switching to other windows, the current application switches to the paused state. Interestingly, the operating system at any time can completely remove this process from memory. Therefore, at the time of suspension, you should save the state of the application, and at the time of returning to the application - restore this state. The Windows Phone 7 Series utility mechanisms independently perform actions to preserve and restore state, so the application developer does not need to take care of this. When switching between applications, the user will also not notice any difference if the application has been removed from memory - he will return to the state in which the application was last located.



There is also another type of event that can interrupt the execution of an application. However, unlike the previous scenario, in this case, the interruption occurs for a short period of time. Such interruptions can occur, for example, when you receive an incoming call or when the alarm goes off. In this case, the application continues its work in the background. However, if the application requires constant interaction from the user (for example, a gaming application), the developer of this application can react to such events and forcefully suspend the application while the external event is being processed.

The process described above from the point of view of the mobile platform is more correct, since it allows not to waste resources on the execution of unnecessary background applications. Moreover, in this case, the state of the application is saved and restored automatically, which is undoubtedly very convenient from the point of view of the application developer.

However, a number of tasks cannot be implemented using the described process. The fact is that there are some tasks that require background execution. For example, it could be an application to record a user's GPS track or an alarm clock that should work at a certain moment. Unfortunately, in the version of Windows Phone 7 Series, which was introduced at MIX 2010, this functionality is not implemented. However, the development team is currently working on this scenario and soon we will be able to try to implement such scenarios as well.

Thus, it is clear that the approach for organizing the work of many applications in Windows Phone 7 Series has become more effective than it was previously implemented in Windows Phone Classic.

blog.zwezdin.com

Source: https://habr.com/ru/post/88716/


All Articles