SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
IL CICLO DI VITA:
FAST APPLICATION
SWITCHING E FAST RESUME
Dan Ardelean
Nokia Developer Champion
dan@xpresscode.eu Twitter: @danardelean
NOKIA WEBINAR
Stack di navigazione
Launching & Closing
Dormant & Tombstoned
Dizionari di stato
Fast Application Resume
Obscured & Unobscured
Async & await
AGENDA
• Modello di navigazionePage-Based
• Per implementare questo modello di navigazione ogni applicazione ha uno
«Back Stack»
• Navigazioneversouna nuovapaginala vecchiavieneinseritain Back Stack
• Quandoviene premutoil tasto Back o chiamatoil metodoGoBack l’applicazioneritorna
alla primapaginadentroBack Stack
• Se Back Stack è vuotoquandosi navigaindietrol’applicazioneviene chiusa
LE BASI
• Possiamo manualmente rimuovere elementi dallo stack
• Non possiamo manualmente aggiungere elementi
• Le pagine possono essere notificatese vengono rimosse dallo stack
STACK DI NAVIGAZIONE
private void PurgeBackStackButton_Click(object sender, RoutedEventArgs
e)
{
while (NavigationService.CanGoBack)
NavigationService.RemoveBackEntry();
}
protected override void OnRemovedFromJournal(JournalEntryRemovedEventArgs
e)
{
base.OnRemovedFromJournal(e);
}
Not running
Running
Launching
LANCIO APPLICAZIONE
Not running
Running
Launching
Closing
Deactivating
Dormant
Exit
Application_Closing
Deactivate
Application_Deactivate
d
Dormant
CHIUSURA & DISATTIVAZIONE
Istanza in memoria
Stato applicazione, data e oggetti non vengono
modificati
Deve essere pronta per essere chiusa
DORMANT
Not running
Running
LaunchingClosing
DeactivatingActivating
Dormant
AttivaDormantTombstoned
Tombstoned
Not running
Running
LaunchingClosing
DeactivatingActivating
Dormant
Da Dormant a Tombstone «memory based»
Salva i dizionari di stato e lo stack di navigazione
Bisogna ricaricare i dati
TOMBSTONED
Tombstoned
Not running
Running
LaunchingClosing
DeactivatingActivating
Dormant
TOMBSTONED O
DORMANT?
private void Application_Activated(object sender, ActivatedEventArgs e)
{
if (e.IsApplicationInstancePreserved)
{
// Dormant
}
else
{
// Tombstoned
}
}
Riattiva l’istanza dormant se l’utente lancia una
nuova istanza
Necessario per le applicazioni che fanno
tracking della posizionee non solo
FAST APPLICATION RESUME
Tombstoned
Not running
Running
LaunchingClosing
DeactivatingActivating
Dormant
TERMINAZIONE NORMALE
M
O
O
O
DORMANT
O
O
O
IsApplicationInstancePreserved
==true
TOMBSTONED
O
O
IsApplicationInstancePreserve
d
==false
M
O
TOMBSTONED
O
O
O
o
O
• 3 Dizionari
• Pagina:
PhoneApplicationPage.State
• Istanzaapp
PhoneApplicationService.Current.State
• Applicazione
System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings
STATO APPLICAZIONE
MANAGEMENT DELLE RISORSE
O
O
MediaPlayer.Pause
MediaElement.Pause
VibrateController.Stop
Photocamera.Dispose
MANAGEMENT DELLE RISORSE
O
Socket rimangano scollegati
MediaElement non connesso
Photocamera disposed
• Riattiva l’istanza Dormant, se esiste, quando l’utente lancia nuovamente
l’applicazione
• Per abilitare la funzionalità bisogna modificare
PropertiesWMAppManifest.xml
FAST APPLICATION RESUME
<Tasks>
<DefaultTask Name ="_default" NavigationPage="MainPage.xaml"
ActivationPolicy="Resume">
</Tasks>
• Quando l’interfaccia utente viene oscurata: notifiche toast, lockscreen,
chiamata in arrivo
• L’applicazionecontinua girare in background
• Per far girare l’applicazione dietro Lockscreen
• Per disabilitareil Lockscreen
OBSCURED & UNOBSCURED
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
• Cosa succede quando usiamo async e await per Application_Closing e
Application_Deactivate?
• Meccanismo per applicazioni Windows Store
ASYNC E AWAIT
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity.
await ExecuteAsync();
deferral.Complete();
10/1/2013© 2013 Nokia. All rights reserved.
© 2013 Microsoft. All rights reserved.
Grazie!
Blog: sviluppomobile.blogspot.com
Email: dan@xpresscode.eu
Twitter: @danardelean

Weitere ähnliche Inhalte

Andere mochten auch

Corporate House For Rent/Lease - 19000sq.ft Brand New and Unfurnished at Sate...
Corporate House For Rent/Lease - 19000sq.ft Brand New and Unfurnished at Sate...Corporate House For Rent/Lease - 19000sq.ft Brand New and Unfurnished at Sate...
Corporate House For Rent/Lease - 19000sq.ft Brand New and Unfurnished at Sate...Vikas25185
 
Estadon del arte de avion
Estadon del arte de avionEstadon del arte de avion
Estadon del arte de avionluis10002
 
20160124地中海鑽石皇冠號十日歲末促銷NT$78000全包式行程)
20160124地中海鑽石皇冠號十日歲末促銷NT$78000全包式行程)20160124地中海鑽石皇冠號十日歲末促銷NT$78000全包式行程)
20160124地中海鑽石皇冠號十日歲末促銷NT$78000全包式行程)府城旅行社
 
Andbank noticia Expansión
Andbank noticia ExpansiónAndbank noticia Expansión
Andbank noticia ExpansiónAndbank
 
Herramientas para crear organizadores graficos
Herramientas para crear organizadores graficosHerramientas para crear organizadores graficos
Herramientas para crear organizadores graficosdaniel chango
 
4 q09 conference call presentation
4 q09 conference call presentation4 q09 conference call presentation
4 q09 conference call presentationBancoABCRI
 
Voćna iznenadjenja
Voćna iznenadjenjaVoćna iznenadjenja
Voćna iznenadjenjaZorana Galic
 

Andere mochten auch (12)

Corporate House For Rent/Lease - 19000sq.ft Brand New and Unfurnished at Sate...
Corporate House For Rent/Lease - 19000sq.ft Brand New and Unfurnished at Sate...Corporate House For Rent/Lease - 19000sq.ft Brand New and Unfurnished at Sate...
Corporate House For Rent/Lease - 19000sq.ft Brand New and Unfurnished at Sate...
 
Estadon del arte de avion
Estadon del arte de avionEstadon del arte de avion
Estadon del arte de avion
 
Maine Municipal Association 2013
Maine Municipal Association 2013Maine Municipal Association 2013
Maine Municipal Association 2013
 
Unidad 2
Unidad 2Unidad 2
Unidad 2
 
20160124地中海鑽石皇冠號十日歲末促銷NT$78000全包式行程)
20160124地中海鑽石皇冠號十日歲末促銷NT$78000全包式行程)20160124地中海鑽石皇冠號十日歲末促銷NT$78000全包式行程)
20160124地中海鑽石皇冠號十日歲末促銷NT$78000全包式行程)
 
Andbank noticia Expansión
Andbank noticia ExpansiónAndbank noticia Expansión
Andbank noticia Expansión
 
Helsingin alueellisen kulttuurityön malli
Helsingin alueellisen kulttuurityön malliHelsingin alueellisen kulttuurityön malli
Helsingin alueellisen kulttuurityön malli
 
Herramientas para crear organizadores graficos
Herramientas para crear organizadores graficosHerramientas para crear organizadores graficos
Herramientas para crear organizadores graficos
 
vinco pharma, kwara
vinco pharma, kwaravinco pharma, kwara
vinco pharma, kwara
 
4 q09 conference call presentation
4 q09 conference call presentation4 q09 conference call presentation
4 q09 conference call presentation
 
Voćna iznenadjenja
Voćna iznenadjenjaVoćna iznenadjenja
Voćna iznenadjenja
 
McGill Brand Needle Bearings
McGill Brand Needle BearingsMcGill Brand Needle Bearings
McGill Brand Needle Bearings
 

Mehr von Microsoft Mobile Developer

Intro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsIntro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsMicrosoft Mobile Developer
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagMicrosoft Mobile Developer
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsMicrosoft Mobile Developer
 
Windows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appWindows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appMicrosoft Mobile Developer
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeMicrosoft Mobile Developer
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoMicrosoft Mobile Developer
 

Mehr von Microsoft Mobile Developer (20)

Intro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsIntro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and tools
 
Lumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK betaLumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK beta
 
Nokia Asha from idea to app - Imaging
Nokia Asha from idea to app - ImagingNokia Asha from idea to app - Imaging
Nokia Asha from idea to app - Imaging
 
Healthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia AshaHealthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia Asha
 
Push notifications on Nokia X
Push notifications on Nokia XPush notifications on Nokia X
Push notifications on Nokia X
 
DIY Nokia Asha app usability studies
DIY Nokia Asha app usability studiesDIY Nokia Asha app usability studies
DIY Nokia Asha app usability studies
 
Lessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviewsLessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviews
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tag
 
HERE Maps for the Nokia X platform
HERE Maps for the Nokia X platformHERE Maps for the Nokia X platform
HERE Maps for the Nokia X platform
 
Nokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerationsNokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerations
 
Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)
 
UX considerations when porting to Nokia X
UX considerations when porting to Nokia XUX considerations when porting to Nokia X
UX considerations when porting to Nokia X
 
Kids' games and educational app design
Kids' games and educational app designKids' games and educational app design
Kids' games and educational app design
 
Nokia X: opportunities for developers
Nokia X: opportunities for developersNokia X: opportunities for developers
Nokia X: opportunities for developers
 
Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1
 
Intro to Nokia X software platform and tools
Intro to Nokia X software platform and toolsIntro to Nokia X software platform and tools
Intro to Nokia X software platform and tools
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
 
Windows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appWindows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra app
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo store
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progetto
 

Kürzlich hochgeladen

Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...Associazione Digital Days
 
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...Associazione Digital Days
 
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...Associazione Digital Days
 
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...Associazione Digital Days
 
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...Associazione Digital Days
 
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”Associazione Digital Days
 
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...Associazione Digital Days
 
Programma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 TorinoProgramma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 TorinoQuotidiano Piemontese
 
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...Associazione Digital Days
 

Kürzlich hochgeladen (9)

Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
Alessio Mazzotti, Aaron Brancotti; Writer, Screenwriter, Director, UX, Autore...
 
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
Mael Chiabrera, Software Developer; Viola Bongini, Digital Experience Designe...
 
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
Luigi Di Carlo, CEO & Founder @Evometrika srl – “Ruolo della computer vision ...
 
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
Federico Bottino, Lead Venture Builder – “Riflessioni sull’Innovazione: La Cu...
 
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
Alessandro Nasi, COO @Djungle Studio – “Cosa delegheresti alla copia di te st...
 
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
Edoardo Di Pietro – “Virtual Influencer vs Umano: Rubiamo il lavoro all’AI”
 
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
Gabriele Mittica, CEO @Corley Cloud – “Come creare un’azienda “nativa in clou...
 
Programma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 TorinoProgramma Biennale Tecnologia 2024 Torino
Programma Biennale Tecnologia 2024 Torino
 
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
Daniele Lunassi, CEO & Head of Design @Eye Studios – “Creare prodotti e servi...
 

Il Ciclo di Vita Fast Application Switching e Fast Resume