Mango-developer (1)

Source: Internet
Author: User

Http://www.wpmind.com/dev/2011/05/26/whats-new-in-mango-for-dev-1.html

Yesterday, Microsoft announced more details about the next major update code for Windows Phone, mango, and released mango Development Tool Windows Phone Developer Tools 7.1 (Beta ). This article will briefly discuss the changes brought about by Mango from the developer perspective.

What's new

First, let's take a look at the new things that make your heart beat in mango?

1. Sensor API:

Enhanced sensor APIs. First, addedCompass Sensor(Optional)GyroscopeSensors and their APIs. Mix11 once mentioned a concept called motion sensor, but this name is too easy to misunderstand. When talking about sensor, you will think of specific hardware sensors. However, the motion sensor/motion API only encapsulates the raw data of the accelerometer, compass sensor, and gyroscope at a high-level level, so that you can make better use of the data of these sensors. Therefore, this group of highly encapsulated APIS is now called the motion API.

Secondly, you are allowed to access mango directly.CameraThe original frame data. In addition to flash, autofocus, and shutter buttons. This makes it possible for you to develop special effect photo software like camera360 or some real-time enhancement software.

2. Multi tasking:

That is, the most talked about multi-task functions. FirstFast app SwitchingTo quickly switch applications. In fact, users don't care whether you are multitasking or not. What they care about is that I open program a and switch it out to use program B. When I return to program a, can program a continue with the interrupted part, of course, this program a must be able to quickly switch over.

In the Windows Phone 7 era, Microsoft proposed the tombstoned concept. That is, when your program is running, if you press the Home Key to cut out or suffer some interference (for example, if you open the contact selector in the Program, your program will enter a tombstone state. In this tombstone state, you need to save all the current states, and your program has actually exited the running state. Then, when your program is activated again (for example, when the selector is disabled), the system automatically enters the page you just entered the tombstone mechanism, you need to manually restore the data you just saved in the code. In this way, a task is switched to the background and then restored.

However, the fatal disadvantage of this operation is that all programs need to be tombstone after switching out, which leads to extremely low switching efficiency. Therefore, a new State is introduced in mango, called dormant (sleep ). When a program is disabled, it first tries to enter the dormant state. In the dormant state, the program does not exit, but all thread activities in the program will be suspended and kept in the memory. When your program is activated again, it can simply restore the program from its sleep state. In this way, program switching and recovery will be fast. However, not all programs will enter the dormant state after being switched, depending on the current system resources. If the memory is insufficient, it will automatically switch your program to the tomb cup state. However, if you recover from the tombstone status, you need to restore your work in the same status as before. With dormant, Mango makes fast application switching and recovery possible.

So how many programs in the system can be sleep at the same time? It does not seem to be mentioned in this document. According to wpmind, this should depend on the system memory. There is a maximum number of programs entering the tombstone state, that is, there are only five tombstone programs at the same time.

But you will say that dormant is not really a multi-task. Yes, this is not a real multitasking. Because after your program sleep, the third-party applications that run concurrently in the system are always only one. Well, this depends on the other two most important concepts in Mango:Notification ServiceAndBackground agents.

Notification Service, also known as scheduled notification in this document. It allows your program to specify a time interval to send an alerm or reminder dialog box to the user. Of course, at this time your program may not run (or even the phone has restarted ). You can specify the user to open your own program and enter a specific page when encountering the reminder dialog box.

In addition to the notification service, Mango also provides background agents, also known as scheduled tasks. It allows your program to execute some tasks in the background. Of course, your program may not run in the foreground at this time. There are two types of background agents available: periodictask and resourceintensivetask.

Periodic Agents usually runs every 30 minutes for 15 seconds. With this agent, you can perform small tasks in the system cycle, such as getting your location and synchronizing data with the server.

Resourceintensivetask is the resource-intensive agent, which can be idle on your mobile phone (CPU is idle, no call is made, etc.) and has sufficient power (power is inserted or more than 90% of the power) automatically run for 10 minutes. However, there is another abnormal demand, that is, the mobile phone does not have a data network connection at this time. This means that your mobile phone must be connected to your computer through Wi-Fi or USB cable. In this scenario, wpmind is suitable for some industry users, such as gathering information, returning to the office, connecting the mobile phone to the power supply, and then synchronizing a large amount of data.

In addition, Mango has two background services that can be used in some background application scenarios:Background File Transfer ServiceAndBackground Audio Service. The Background File Transfer Service allows your program to communicate with other Web servers in the background (get or post) to upload or download files. However, the data uploaded through post cannot exceed 3 MB, and the downloaded data can only be 20 mb when the mobile phone is connected to wifi or USB cable. To use this service, you need to specify the target, local storage path, and transmission mode (get or post). You no longer need to process complicated httpwebrequest objects by yourself.

The background audio service allows your program to play and control music during background running. The guy who wants to make his own music player can finally make it easy. After all, in Windows Phone 7, many people have dismissed the idea of making his own music player because he does not support this function.

Through fast app switching, background agents, notification service, and the background file transfer service and background audio service just introduced, mango has finally opened some channels for developers so that you can develop more interesting applications.

Okay. I will write it here today. I will continue to introduce the remaining parts of this picture tomorrow.

Note:This article is sourced from some of mix11 courses and Windows Phone Developer Tools 7.1 (Beta) documents. The mango Knowledge mentioned in this article may change after the official version of mango is published.

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.