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 issue. To do this, we turn to the implementation of multitasking in Windows Phone Classic (the old name is Windows Mobile 5.x, 6.x).

    In Windows Phone Classic, multitasking was fully implemented. This means that at the same moment in time, several applications can be executed without suspension. This, in fact, is some analogue of the desktop platform, where this process looks similarly. However, let's think - is the use of such an approach for the mobile platform as justified as for the desktop?

    Let's try to introduce a typical mobile device usage scenario. Surely it will include the use of several applications in turn for a long amount of time. For example, at the moment I am using several such applications: viewing photos, reading e-mail, reading Twitter feeds, viewing current traffic, Windows Media Player, editing and viewing Microsoft Office documents, viewing PDF documents, calculators, etc. For long-term use of the device, you can find that all or part of these applications are loaded in memory, and at the moment they are completely unnecessary, since there is no need to use them. However, at the moment they are really loaded into memory and executed, load the central processor, occupy the memory and consume the battery. Of course, some users are careful to ensure that at the moment only the necessary applications are downloaded, but not everyone does this. For this reason, the use of such an approach is not justified for the mobile platform.

    On some mobile platforms, there is another extreme - the ability to run only one application at a time. This approach is also not correct, because sometimes it is still necessary to run several applications at the same time. A classic example is the use of a music player when 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 run at any one 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 a suspended state. Interestingly, the operating system at any time can completely delete 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 service mechanisms of Windows Phone 7 Series independently carry out actions to save and restore state, so the application developer does not need to worry about this.



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

    The process described above from the point of view of the mobile platform is more correct, since it allows you 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 realized using the described process. The fact is that there are some tasks that require background execution. For example, it can be an application for recording 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 that was introduced at MIX 2010, this functionality is not implemented. However, the development team is currently engaged in this scenario and in the near future we will be able to try to implement such scenarios.

    Thus, it can be seen that the approach to 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

    Also popular now: