SlideShare a Scribd company logo
Windows XAML+ 
Silverlight 8.1 
Building Apps for Windows Phone 8.1 Jump Start 
24 апреля 2014
PeriodicTask, ResourceIntensiveTask
Триггер Инфо 
System Trigger Запускается при определенном событии 
События: UserPresent/Away, NetworkStateChange, InternetAvailable, 
SessionConnected, ServicingComplete, TimeZoneChange 
Также: LockScreenApplicationAdded и LockScreenApplicationRemoved 
недоступны для Windows Phone 
TimeTrigger Запускается периодически (минимальный интервал - 30 мин) 
LocationTrigger Запускается при изменении местоположения 
MaintenanceTrigger Запускается периодически (минимальный интервал - 30 мин), но 
только если устройство работает на зарядке 
PushNotificationTrigger Запускается при получении raw push notification
Триггер Инфо 
RfcommConnectionTrigger Bluetooth: когда установлено RFCOMM соединение 
DeviceChangeTrigger Bluetooth: когда установлено/закрыто ACL соединение 
BluetoothSignalStrengthTrigger Bluetooth: когда изменяются параметры сигнала 
GattCharacteristicNotificationTrigger Bluetooth: когда получены изменения от Bluetooth LE устройства
Условие 
User[Not]Present 
Internet[Not]Available 
FreeNetworkAvailable 
BackgroundWorkCostNotHigh 
“run this task every 30 minutes if the internet is available”
async void RegisterBackgroundTasks() 
{ 
// On Windows, RequestAccessAsync presents the user with a confirmation 
// dialog that requests that an app be allowed on the lock screen. 
// On Windows Phone, RequestAccessAsync does not show any user confirmation UI 
// but *must* be called before registering any tasks 
var access = await BackgroundExecutionManager.RequestAccessAsync(); 
// A 'good' status return on Phone is BackgroundAccess.AllowedMayUseActiveRealTimeConnectivity 
if (access == BackgroundAccessStatus.Denied) 
{ 
// Either the user has explicitly denied background execution for this app 
// or the maximum number of background apps across the system has been reached 
// Display some informative message to the user... 
} 
}
Появился в Windows Phone 8.1 
Управляет списком приложений, 
которые работают в фоне: 
текущий статус, нагрузка на 
батарею
BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder(); 
taskBuilder.Name = "MyBackgroundTask"; 
// Many different trigger types could be used here 
SystemTrigger trigger = new SystemTrigger(SystemTriggerType.TimeZoneChange, false); 
taskBuilder.SetTrigger(trigger); 
taskBuilder.AddCondition(new SystemCondition(SystemConditionType.InternetAvailable)); 
// Entry point is the full name of our IBackgroundTask implementation 
// Good practice to use reflection as here to ensure correct name 
taskBuilder.TaskEntryPoint = typeof(MyBackgroundTask.TheTask).FullName; 
BackgroundTaskRegistration registration = taskBuilder.Register(); 
// Optionally, handle the progress/completed events of the task 
registration.Progress += registration_Progress; 
registration.Completed += registration_Completed;
// AllTasks is a dictionary <Guid, IBackgroundTaskRegistration> so you can get back 
// to your registration by id or by posiiton, or select First if you only have one registration. 
var taskRegistration = BackgroundTaskRegistration.AllTasks.Values.FirstOrDefault(); 
// We could then unregister the task, optionally cancelling any running instance 
if (taskRegistration != null) 
{ 
taskRegistration.Unregister(true); 
} 
// Release the progress/completed event subscriptions 
registration.Progress -= registration_Progress; 
registration.Completed -= registration_Completed;
3 2 1 
4 
<?xml version=“1.0”> 
Type = raw, Data = Man City.... 
</xml>
Ограничения основаны на текущем использовании ЦПУ. В Windows Phone: ограничение ЦПУ - 2 
секунды на приложение, обновляется каждые 15 минут 
Ограничения на память зависят от параметров устройства
Тип задачи 512 МБ 1 ГБ 2 ГБ и более 
Местоположение 16 30 40 
Bluetooth 16 16 16 
Сервисные задачи 10 10 10 
Другие 16 30 40 
В режиме отладки 30 40 50
The information contained in this document represents the current view of Microsoft Corp. on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be 
interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This guide is for informational purposes only. MICROSOFT MAKES NO 
WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in 
or introduced into a retrieval system, or transmitted in any form, by any means (electronic, mechanical, photocopying, recording or otherwise), or for any purpose, without the express written permission of Microsoft. Microsoft may have 
patents, patent applications, trademarks, copyrights or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this 
document does not give you any license to these patents, trademarks, copyrights or other intellectual property. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events 
depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred.

More Related Content

Similar to Фоновые задачи и многозадачность для Windows Phone

Ciclo di vita di una applicazione Windows Phone Store
Ciclo di vita di una applicazione Windows Phone StoreCiclo di vita di una applicazione Windows Phone Store
Ciclo di vita di una applicazione Windows Phone Store
Dan Ardelean
 
11 background tasks and multitasking
11   background tasks and multitasking11   background tasks and multitasking
11 background tasks and multitasking
WindowsPhoneRocks
 
Offline Network Detection in Microsoft Silverlight 3
Offline Network Detection in Microsoft Silverlight 3Offline Network Detection in Microsoft Silverlight 3
Offline Network Detection in Microsoft Silverlight 3
goodfriday
 
Beat the Clock: Background Tasking in Windows 8
Beat the Clock: Background Tasking in Windows 8Beat the Clock: Background Tasking in Windows 8
Beat the Clock: Background Tasking in Windows 8
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
 
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Frédéric Harper
 
#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run
Frederik De Bruyne
 
What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2
Santosh Singh Paliwal
 
Reactive Data System
Reactive Data SystemReactive Data System
Reactive Data System
Pridhvi Kodamasimham
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 series
openbala
 
Level 4
Level 4Level 4
Level 4
skumartarget
 
Push registrysup
Push registrysupPush registrysup
Push registrysup
SMIJava
 
Windows8 매트로스타일 앱개발 개요
Windows8 매트로스타일 앱개발 개요Windows8 매트로스타일 앱개발 개요
Windows8 매트로스타일 앱개발 개요
KH Park (박경훈)
 
Installation
InstallationInstallation
Installation
azarudeen26
 
C# and Borland StarTeam Connectivity
C# and Borland StarTeam ConnectivityC# and Borland StarTeam Connectivity
C# and Borland StarTeam Connectivity
Shreesha Rao
 
Struts2 in a nutshell
Struts2 in a nutshellStruts2 in a nutshell
Struts2 in a nutshell
Shinpei Ohtani
 
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
FastBit Embedded Brain Academy
 
performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)
QA Programmer
 
performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02
Gopi Raghavendra
 
Bitlockerflow
BitlockerflowBitlockerflow
Bitlockerflow
khaihuynhit
 
How to build typing indicator in a Chat app
How to build typing indicator in a Chat appHow to build typing indicator in a Chat app
How to build typing indicator in a Chat app
Kommunicate Intentive Technology
 

Similar to Фоновые задачи и многозадачность для Windows Phone (20)

Ciclo di vita di una applicazione Windows Phone Store
Ciclo di vita di una applicazione Windows Phone StoreCiclo di vita di una applicazione Windows Phone Store
Ciclo di vita di una applicazione Windows Phone Store
 
11 background tasks and multitasking
11   background tasks and multitasking11   background tasks and multitasking
11 background tasks and multitasking
 
Offline Network Detection in Microsoft Silverlight 3
Offline Network Detection in Microsoft Silverlight 3Offline Network Detection in Microsoft Silverlight 3
Offline Network Detection in Microsoft Silverlight 3
 
Beat the Clock: Background Tasking in Windows 8
Beat the Clock: Background Tasking in Windows 8Beat the Clock: Background Tasking in Windows 8
Beat the Clock: Background Tasking in Windows 8
 
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
 
#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run
 
What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2
 
Reactive Data System
Reactive Data SystemReactive Data System
Reactive Data System
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 series
 
Level 4
Level 4Level 4
Level 4
 
Push registrysup
Push registrysupPush registrysup
Push registrysup
 
Windows8 매트로스타일 앱개발 개요
Windows8 매트로스타일 앱개발 개요Windows8 매트로스타일 앱개발 개요
Windows8 매트로스타일 앱개발 개요
 
Installation
InstallationInstallation
Installation
 
C# and Borland StarTeam Connectivity
C# and Borland StarTeam ConnectivityC# and Borland StarTeam Connectivity
C# and Borland StarTeam Connectivity
 
Struts2 in a nutshell
Struts2 in a nutshellStruts2 in a nutshell
Struts2 in a nutshell
 
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
 
performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)
 
performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02
 
Bitlockerflow
BitlockerflowBitlockerflow
Bitlockerflow
 
How to build typing indicator in a Chat app
How to build typing indicator in a Chat appHow to build typing indicator in a Chat app
How to build typing indicator in a Chat app
 

More from Mykhail Galushko

Software development process for outsourcing team
Software development process for outsourcing teamSoftware development process for outsourcing team
Software development process for outsourcing team
Mykhail Galushko
 
Локализация и глобализация для Windows Phone Store приложений
Локализация и глобализация для Windows Phone Store приложенийЛокализация и глобализация для Windows Phone Store приложений
Локализация и глобализация для Windows Phone Store приложений
Mykhail Galushko
 
Разрабатываем качественное Windows 8 приложение
Разрабатываем качественное Windows 8 приложениеРазрабатываем качественное Windows 8 приложение
Разрабатываем качественное Windows 8 приложение
Mykhail Galushko
 
Разработка WinRT приложений для Windows 8: реальный опыт, UA Mobile 2012
Разработка WinRT приложений для  Windows 8: реальный опыт, UA Mobile 2012Разработка WinRT приложений для  Windows 8: реальный опыт, UA Mobile 2012
Разработка WinRT приложений для Windows 8: реальный опыт, UA Mobile 2012
Mykhail Galushko
 
ASP.NET MVC+ Windows Azure: step by step guide
ASP.NET MVC+ Windows Azure: step by step guideASP.NET MVC+ Windows Azure: step by step guide
ASP.NET MVC+ Windows Azure: step by step guide
Mykhail Galushko
 
Экосистема Windows 8 и практика разработки приложений
Экосистема Windows 8 и практика разработки приложений Экосистема Windows 8 и практика разработки приложений
Экосистема Windows 8 и практика разработки приложений
Mykhail Galushko
 

More from Mykhail Galushko (6)

Software development process for outsourcing team
Software development process for outsourcing teamSoftware development process for outsourcing team
Software development process for outsourcing team
 
Локализация и глобализация для Windows Phone Store приложений
Локализация и глобализация для Windows Phone Store приложенийЛокализация и глобализация для Windows Phone Store приложений
Локализация и глобализация для Windows Phone Store приложений
 
Разрабатываем качественное Windows 8 приложение
Разрабатываем качественное Windows 8 приложениеРазрабатываем качественное Windows 8 приложение
Разрабатываем качественное Windows 8 приложение
 
Разработка WinRT приложений для Windows 8: реальный опыт, UA Mobile 2012
Разработка WinRT приложений для  Windows 8: реальный опыт, UA Mobile 2012Разработка WinRT приложений для  Windows 8: реальный опыт, UA Mobile 2012
Разработка WinRT приложений для Windows 8: реальный опыт, UA Mobile 2012
 
ASP.NET MVC+ Windows Azure: step by step guide
ASP.NET MVC+ Windows Azure: step by step guideASP.NET MVC+ Windows Azure: step by step guide
ASP.NET MVC+ Windows Azure: step by step guide
 
Экосистема Windows 8 и практика разработки приложений
Экосистема Windows 8 и практика разработки приложений Экосистема Windows 8 и практика разработки приложений
Экосистема Windows 8 и практика разработки приложений
 

Recently uploaded

Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 

Recently uploaded (20)

Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
Artificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic WarfareArtificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic Warfare
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 

Фоновые задачи и многозадачность для Windows Phone

  • 1. Windows XAML+ Silverlight 8.1 Building Apps for Windows Phone 8.1 Jump Start 24 апреля 2014
  • 2.
  • 3.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Триггер Инфо System Trigger Запускается при определенном событии События: UserPresent/Away, NetworkStateChange, InternetAvailable, SessionConnected, ServicingComplete, TimeZoneChange Также: LockScreenApplicationAdded и LockScreenApplicationRemoved недоступны для Windows Phone TimeTrigger Запускается периодически (минимальный интервал - 30 мин) LocationTrigger Запускается при изменении местоположения MaintenanceTrigger Запускается периодически (минимальный интервал - 30 мин), но только если устройство работает на зарядке PushNotificationTrigger Запускается при получении raw push notification
  • 11. Триггер Инфо RfcommConnectionTrigger Bluetooth: когда установлено RFCOMM соединение DeviceChangeTrigger Bluetooth: когда установлено/закрыто ACL соединение BluetoothSignalStrengthTrigger Bluetooth: когда изменяются параметры сигнала GattCharacteristicNotificationTrigger Bluetooth: когда получены изменения от Bluetooth LE устройства
  • 12. Условие User[Not]Present Internet[Not]Available FreeNetworkAvailable BackgroundWorkCostNotHigh “run this task every 30 minutes if the internet is available”
  • 13.
  • 14.
  • 15. async void RegisterBackgroundTasks() { // On Windows, RequestAccessAsync presents the user with a confirmation // dialog that requests that an app be allowed on the lock screen. // On Windows Phone, RequestAccessAsync does not show any user confirmation UI // but *must* be called before registering any tasks var access = await BackgroundExecutionManager.RequestAccessAsync(); // A 'good' status return on Phone is BackgroundAccess.AllowedMayUseActiveRealTimeConnectivity if (access == BackgroundAccessStatus.Denied) { // Either the user has explicitly denied background execution for this app // or the maximum number of background apps across the system has been reached // Display some informative message to the user... } }
  • 16. Появился в Windows Phone 8.1 Управляет списком приложений, которые работают в фоне: текущий статус, нагрузка на батарею
  • 17. BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder(); taskBuilder.Name = "MyBackgroundTask"; // Many different trigger types could be used here SystemTrigger trigger = new SystemTrigger(SystemTriggerType.TimeZoneChange, false); taskBuilder.SetTrigger(trigger); taskBuilder.AddCondition(new SystemCondition(SystemConditionType.InternetAvailable)); // Entry point is the full name of our IBackgroundTask implementation // Good practice to use reflection as here to ensure correct name taskBuilder.TaskEntryPoint = typeof(MyBackgroundTask.TheTask).FullName; BackgroundTaskRegistration registration = taskBuilder.Register(); // Optionally, handle the progress/completed events of the task registration.Progress += registration_Progress; registration.Completed += registration_Completed;
  • 18. // AllTasks is a dictionary <Guid, IBackgroundTaskRegistration> so you can get back // to your registration by id or by posiiton, or select First if you only have one registration. var taskRegistration = BackgroundTaskRegistration.AllTasks.Values.FirstOrDefault(); // We could then unregister the task, optionally cancelling any running instance if (taskRegistration != null) { taskRegistration.Unregister(true); } // Release the progress/completed event subscriptions registration.Progress -= registration_Progress; registration.Completed -= registration_Completed;
  • 19.
  • 20.
  • 21.
  • 22. 3 2 1 4 <?xml version=“1.0”> Type = raw, Data = Man City.... </xml>
  • 23.
  • 24.
  • 25. Ограничения основаны на текущем использовании ЦПУ. В Windows Phone: ограничение ЦПУ - 2 секунды на приложение, обновляется каждые 15 минут Ограничения на память зависят от параметров устройства
  • 26. Тип задачи 512 МБ 1 ГБ 2 ГБ и более Местоположение 16 30 40 Bluetooth 16 16 16 Сервисные задачи 10 10 10 Другие 16 30 40 В режиме отладки 30 40 50
  • 27.
  • 28.
  • 29. The information contained in this document represents the current view of Microsoft Corp. on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This guide is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form, by any means (electronic, mechanical, photocopying, recording or otherwise), or for any purpose, without the express written permission of Microsoft. Microsoft may have patents, patent applications, trademarks, copyrights or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights or other intellectual property. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred.

Editor's Notes

  1. .