La descarga está en progreso. Por favor, espere

La descarga está en progreso. Por favor, espere

Eduardo Ortega MVP Device Application Development

Presentaciones similares


Presentación del tema: "Eduardo Ortega MVP Device Application Development"— Transcripción de la presentación:

1 Eduardo Ortega MVP Device Application Development
Multitasking Eduardo Ortega MVP Device Application Development

2 Windows Phone 7.5 Modelo de ejecución

3 Modelo de ejecución Mango introduce un nuevo estado: Dormant
Reanudación de aplicaciones rápida (sin Resuming…) Se busca experiencia de usuario rápida y receptiva Una sola aplicación en primer plano Experiencia de navegación entre aplicaciones consistente Novedad en Mango: Mantener pulsado back button para cambiar a la aplicación anterior

4 Ciclo de vida de una aplicación

5 Ciclo de vida de una aplicación
Rápida reanudación de App running deactivated dormant activated Estado conservado! IsAppInstancePreserved == true Guardar Estado! Tombstoned Tombstone App más antigua Desasociar recursos del teléfono Threads & timers suspendidos

6 Modelo de aplicación OnNavigatedFrom/Deactivated
MIX 11 4/1/2017 Modelo de aplicación OnNavigatedFrom/Deactivated Salvar estado de página/ aplicación OnNavigatedTo/Activated Resaturar estado de página/aplicación si tombstoning WP7: la mayoría de las veces Apps Tombstoned Mango: Apps Tombstoned a veces © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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 provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

7 Resumiendo la aplicación…
private void Application_Activated(object sender, ActivatedEventArgs e) { if (e.IsApplicationInstancePreserved) // Dormant – objetos intactos en memoria } else // Tombstoned – necesita recargar los datos 7

8 Fast Application Switching
4/1/2017 6:51 PM Fast Application Switching © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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 provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 Windows Phone 7.5 Background Tasks

10 Capacidades de multitasking
Background Agents Periodic Resource Intensive Background Transfer Service Alarms and Reminders Background Audio

11 Windows Phone 7.5 Background Agents

12 Background Agents Agentes Una aplicación solo puede tener uno de cada
Periodicos Recursos Intensivos Una aplicación solo puede tener uno de cada Inicializado en primer plano, se ejecuta en segundo plano Persiste entre reinicios Control de usuario de la configuración Maximo del sistema 18 agentes periódicos Los agentes se ejecutan hasta 14 días (pueden ser renovados)

13 Tipos de agentes Agentes de Recursos Intensivos Agentes Periodicos
Ocurrencia Fuente externa Red no celular Duración 10 minutos Restricciones <= 6 MB Memoria Agentes Periodicos Ocurrencia Cada 30 min Duración ~15 seconds Restricciones <= 6 MB Memoria <=10% CPU 1313 Windows Phone

14 Funcionalidades de los agentes
Permitidas Restringidas Tiles Toast Location Network R/W ISO store Sockets Most framework APIs Display UI XNA libraries Microphone and Camera Sensors Play audio (may only use background audio APIs) 1414

15 Depurando un Background Task
#if DEBUG_AGENT ScheduledActionService.LaunchForTest(taskName, TimeSpan.FromSeconds(60)); #endif 1515

16 Background Agents 4/1/2017 6:51 PM
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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 provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

17 Windows Phone 7.5 Background Notification Services

18 Alarmas vs Recordatorios
Rich information Integrates with other reminders Snooze and Dismiss Launch app Follows the phones global settings Modal Snooze and Dismiss Sound customization No app invocation No stacking

19 Recordatorios

20 Alarmas

21 Background Notification Services
4/1/2017 6:51 PM Background Notification Services © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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 provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

22 Windows Phone 7.5 Background Audio

23 Background Audio Mango proporciona 2 agentes para reproducción de audio en segundo plano AudioPlayerAgent  reproducción de audio basada en URIs locales o remotas Rutas locales a archivos del almacenamiento aislado URL a un archivo remoto Restricción: archivos con formato compatible (.mp3 o .wav) AudioStreamingAgent  audio stream de la web

24 Espacio de nombres: Microsoft.Phone.BackgroundAudio
Clase Descripción AudioPlayerAgent Implementación de BackgroundAgent específica para reproducir audio en background AudioStreamer Stream de audio que puede reproducirse mediante el reproductor del sistema AudioStreamingAgent Agente en segundo plano que reproduce streaming por pista AudioTrack Pista de audio BackgroundAudioPlayer Proporciona acceso en background a funcionalidades de reproducción como reproducir, pausar, adelantar o rebobinar Enumeración Descripción Valores EnabledPalyerControls Especifica los controles del reproductor habilitados en el interfaz de usuario None, SkipNext, SkipPrevious, FastForward,Rewind, Pause, All PlayState Posibles estados en los que se encuentra el reproductor con respecto a la aplicación actual con audio en background Unknown, Stopped, Paused, Playing, BufferingStarted, BufferingStopped, TrackReady, TrackEnded, Rewind, FasForwarding, Shutdown, Error UserAction Posibles acciones del usuario Stop, Pause, Play, SkipNext, SkipPrevious, FastForward, Rewind, Seek

25 Background Audio Demo: How To: Play BackgroundAudio

26 Background Audio 4/1/2017 6:51 PM
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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 provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

27 Windows Phone 7.5 Background File Transfer

28 Transferencia de archivos en Background
Descargas archivos ejecutándose segundo plano Continúan aunque aplicación no esté ejecutándose primer plano Posibilidad de encolar transferencias (subidas o descargas) APIs consulta estado transferencias e indicadores de progreso Espacio de nombres: Microsoft.Phone.BackgroundTransferService BackgroundTransferService gestión transferencias existentes BackgroundTransferRequest  una única petición GET HTTP descarga y POST HTTP subida

29 Requisitos de la aplicación
Transferencias iniciadas por el usuario o consciente de que se están ejecutando Posibilidad de mostrar transferencias en proceso Posibilidad de cancelar transferencias activas o pendientes Posibilidad forzar transferencias sólo cuando haya WiFi Obligatorio Recomendado

30 Restricciones del sistema de archivos
Transferencias requieren ruta archivo local Descargas ruta específica de almacenamiento Subidas  ruta en la que se encuentra el archivo a enviar Todas las rutas locales en almacenamiento aislado en directorio Transfers Creado por el SO durante instalación Puede albergar estructura de directorio adicional Iniciar transferencia fuera directorio Transfers  Exception!!

31 Políticas de transferencia de archivos
Transferencias iniciadas cuando se cumplan requisitos BackgroundTransferRequest.TransferPreferences SO obliga a cumplir restricciones Tamaños Máximo archivo subida 5MB Máximo tamaño de descarga en conexión de datos 20 MB (Si se sobrepasa  TransferPreferences cambia a AllowBattery  se precisa WiFi para la transferencia) Máximo tamaño de descarga sobre WiFi sin alimentación externa 100MB Máximo tamaño de descarga sobre WiFi con alimentación externa y TransferPreferences = None o AllowCellular Sin límite Máximo número de peticiones en cola (activas y pendientes) / aplicación 5 ( transferencias no eliminadas de la cola automáticamente  aplicaciones deben llamar al método Remove(backgroundTransferRequest)

32 Políticas de transferencia de archivos
SO obliga a cumplir restricciones Servicio de transferencia segundo plano No se ejecuta en redes 2G EDGE GPRS Estándar Requiere redes 3G o superiores Límites Máximo número total de transferencias concurrentes (de todas las aplicaciones del dispositivo) 2 Máximo número total de transferencias encoladas 500 Máximo número de cabeceras HTTP por petición 10 Máximo tamaño de cabeceras HTTP 16K cada una

33 Background File Transfer
4/1/2017 6:51 PM Background File Transfer © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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 provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

34 Q&A

35 GRACIAS www.micmovilidad.es
Eduardo Ortega Jose Antonio Gallego


Descargar ppt "Eduardo Ortega MVP Device Application Development"

Presentaciones similares


Anuncios Google