SlideShare a Scribd company logo
Universal Store Apps
Emanuele Garofalo
What’s new
Who am I?
Emanuele Garofalo
Agenda
Universal
Store
Apps
Perché?
Condivisioni a livello di piattaforma di sviluppo
• API set
• App model
• Live Tiles
• App distribution format
• Controlli
Condivisioni a livello di servizi
• Un solo store
• Shared app identities + entitlement
• Unified Push Services (WNS)
• Unified App Data Roaming and backup
Perché?
Sembra entropia…ma non lo è
Serve a darti la…retro-compatibilità
Windows Phone Store App
Windows Store App
Windows Phone Silverlight
(8.1) App
Facciamo chiarezza
Store Silverlight
People
Hub
VoIP
Emulator, Geolocalization
Geofencing, Accessibility,
Roaming app data, A2A SSO
Share contract, Background transfer
Push notification service
Bluetooth LE, RFComm, WiFi Direct
NFC Secure Payment, Sensors,
MMF (Microsoft Media Foundation),
Photo e Video Capture,
AND MUCH MORE
Audio in
Background
Nuovi
Controlli
XAML
Video editing API
Automated test tools
Alarm
Reminder
Lens App
Creiamo una universal app in visual studio
Il nuovo emulatore
Il nuovo emulatore
Il nuovo emulatore
Il nuovo emulatore
Novità – Punti di convergenza
ControlliApp life cycle
Manifest
BuildDeploy App model
Contratti
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Deploy
App model
• L’app viene sempre ripristinata (Resume)
• Le app non si chiudono con il tasto back
• Le app vengono CHIUSE usanto l’app switcher
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Deploy
App model
Panorama Hub
LongListSelector
ListView
+
Semantic zoom
• FlipView
• GridView
• ListView
• RichEditBox
• PasswordBox
• SemanticZoom
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Deploy
App model
Comuni
Ottimizzati per la piattaforma
Specifici
TextBox
TextBlock
Button CheckBox
Date Picker
Time Picker
Pivot (WP)
AppBar
Punti di convergenza – Controlli ottimizzati
Controlli
App life cycle
Manifest
Deploy
App model
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TimePicker/>
<DatePicker Grid.Row="2" />
</Grid>
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Deploy
App model
APPX for everyone
(tranne che per Silverlight)
• In questo modo le risorse sono organizzate in bundle
• Si riducono le dimensioni dei download
• Non c’è molto da fare da parte nostra se usiamo le risorse
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Deploy
App model
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Deploy
App model
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Deploy
App model
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Deploy
App model
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Deploy
App model
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Build
Deploy
App model
NavigationService
Frame
// Simple navigation, no parameters
Frame.Navigate(typeof(PaginaTarget));
// Passing a simple type, like an ID or an object
Frame.Navigate(typeof(PaginaTarget), “21");
Rispetto alla navigazione
basata su URI abbiamo
il vantaggio di poter passare
parametri di ogni tipo e
non solo testuali
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Build
Deploy
App model
File Open Picker contract
File Save Picker contract
Share contract
And much more…
SHARE DALLA NOSTRA APP
Demo
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Build
Deploy
App model
Navigation Contracts Background
ScheduledTaskAgent
Windows Runtime
Background Tasks
UserPresent , UserAway, SessionConnected,
TimeZoneChange, NetworkStateChange,
InternetAvailable, ServicingComplete, TimeTrigger,
MaintenanceTrigger,
GattCharacteristicNotificationTrigger,
DeviceChangeTrigger, DeviceUpdateTrigger,
RfcommConnectionTrigger, Geofencing
Novità – Punti di convergenza
Controlli
App life cycle
Manifest
Build
Deploy
App model
Navigation Packaging Contracts Background
Geocircle circle = new Geocircle(terminiCenter, radius: 26);
Geofence geofence = new Geofence(“TerminiNikeStore", circle);
GeofenceMonitor.Current.Geofences.Add(geofence);
//Registro il background Task
BackgroundTaskBuilder builder =
new BackgroundTaskBuilder();
builder.SetTrigger(
new LocationTrigger(
LocationTriggerType.Geofence));
Novità – Windows Phone
Integrazione con il Notification Center
Cosa devo fare per integrarmi con il notification center?
(quasi) NIENTE!
Integrazione con il notification center
//Scegliete un template
ToastTemplateType toastTemplate = ToastTemplateType.ToastText02;
//Recuperatene l’xml
XmlDocument toastXml =
ToastNotificationManager.GetTemplateContent(toastTemplate);
//trovate i tag text
XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
//settate il valore dei tag
toastTextElements[0].AppendChild(toastXml.CreateTextNode(toastHeading));
toastTextElements[1].AppendChild(toastXml.CreateTextNode(toastBody));
//scegliete la durata della notifica toast
IXmlNode toastNode = toastXml.SelectSingleNode("/toast");
((XmlElement)toastNode).SetAttribute("duration", "long");
//create la toast notification
ToastNotification toast = new ToastNotification(toastXml);
//Mostrate la toast
ToastNotificationManager.CreateToastNotifier().Show(toast);
Integrazione con il notification center
Per mostrare la notifica solo nel notification center:
toast.SuppressPopup = true;
NB: Se l’utente scegliesse di non mostrare le vostre
notifiche sarebbe tutto (ovviamente) inutile
Integrazione con Cortana
Integrazione con Cortana
Operazione in tre step
Creare il nostro file
con la definizione dei
comandi vocali
Registrare i comandi
vocali all’avvio
dell’applicazione
Gestire l’attivazione
da comandi vocali
Comandi Vocali
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.1">
<CommandSet xml:lang="en-us" Name="englishCommands">
<CommandPrefix> MyApp </CommandPrefix>
<Example> tweet 'welcome to mobileday' </Example>
<Command Name="Tweet">
<Example> tweet 'welcome to mobileday' </Example>
<!-- ListenFor elements provide ways to say the command, including references to
{PhraseLists} and {PhraseTopics} as well as [optional] words -->
<ListenFor> tweet </ListenFor>
<ListenFor> tweet {dictatedSearchTerms} </ListenFor>
<Feedback> tweeting </Feedback>
<!-- Navigate specifies the desired page or invocation destination for the Command-->
<Navigate Target="Tweet.xaml" />
</Command>
<PhraseTopic Label="dictatedSearchTerms" Scenario="Search">
<Subject> twitter </Subject>
</PhraseTopic>
</CommandSet>
</VoiceCommands>
Comandi Vocali
string voiceCommandName;
if (NavigationContext.QueryString.TryGetValue("voiceCommandName", out
voiceCommandName))
{
HandleVoiceCommand(voiceCommandName);
}
else
{
// If we just freshly launched this app without a Voice Command, asynchronously try to
install the
// Voice Commands.
// If the commands are already installed, no action will be taken--there's no need to
check.
Task.Run(() => InstallVoiceCommands());
// Just for fun, we'll also animate the home page buttons
FadeInfoButtons(true);
}
Comandi Vocali
private async void InstallVoiceCommands()
{
try
{
bool using81orAbove = ((Environment.OSVersion.Version.Major >= 8)
&& (Environment.OSVersion.Version.Minor >= 10));
Uri vcdUri = new Uri("ms-appx:///VoiceCommandDefinition_8.1.xml");
await VoiceCommandService.InstallCommandSetsFromFileAsync(vcdUri);
}
catch (Exception ex)
{
//Gestione dell’errore
}
}
Comandi Vocali
void HandleVoiceCommand(string voiceCommandName)
{
string textToTweet = null;
bool tweet = false;
switch (voiceCommandName)
{
case "Tweet":
if (NavigationContext.QueryString.TryGetValue("naturalLanguage", out
phraseTopicContents)
&& !String.IsNullOrEmpty(phraseTopicContents))
{
NavigationContext.QueryString.TryGetValue("dictatedSearchTerms", out
textToTweet);
SendTweet(textToTweet);
}
break;
//…altri comandi…
}
}
DA WINDOWS 8.1 A WINDOWS
PHONE 8.1
Demo
Universal Store Apps - Mobile day by DotNetCampania
Universal Store Apps - Mobile day by DotNetCampania

More Related Content

PPTX
F24ZZ - DDD applicato
PPTX
Developing appealing application using xaml
PPTX
Push notifications
PPTX
Mob03 what's new in windows phone
PPTX
L'EVOLUZIONE E LE NOVITÀ DI WINDOWS PHONE 8.1
PPTX
Wp app studio_new
PDF
Dal web a Windows 8: costruire app Metro immersiv - Daniele Bochiccio - whyMCA
PDF
Hour of Code - 13/01/2016
F24ZZ - DDD applicato
Developing appealing application using xaml
Push notifications
Mob03 what's new in windows phone
L'EVOLUZIONE E LE NOVITÀ DI WINDOWS PHONE 8.1
Wp app studio_new
Dal web a Windows 8: costruire app Metro immersiv - Daniele Bochiccio - whyMCA
Hour of Code - 13/01/2016

Similar to Universal Store Apps - Mobile day by DotNetCampania (20)

PPTX
Contracts & Extensions: allargare i confini della propria applicazione (Win8@...
PPTX
Windows AppStudio, app without code
PDF
OpenDay 3 TIM WCap - 05/05/2016
PDF
Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
PDF
EtnaDev 2015 - Windows Bridge
PPTX
Universal app ma universal per davvero
PDF
MobileDevCamp2012 - Windows Phone
PDF
Programmiamo iPhone e iPad (e non solo!) con MonoTouch
PPTX
Sviluppo di applicazioni mobile cross platform
PPTX
Lavorare con tile, badge e notification nelle applicazioni Windows 8
PDF
MonoTouch, un anno dopo
PPTX
Push Notification: come rendere vive le app su Windows Phone
PPTX
Cert04 70-484 - essentials of developing windows store apps
PPTX
Introduzione alle app Windows Universal
PPTX
Roadmap pubblicazione app WP7 - Community Tour 2011 DotNetUmbria
PPTX
Sviluppo apps multipiattaforma con visual studio e xamarin
PPTX
Push Notification, Live Tile e Background Agent
PPTX
Sviluppo di applicazioni web in ambito mobile
PPTX
UNIVERSAL APP IN TUTTE LE SALSE: PHONE, TABLET, PC, XBOX E IOT
PPTX
Costruire applicazioni-cross-platform-con-xamarin-visual-studio-2013
Contracts & Extensions: allargare i confini della propria applicazione (Win8@...
Windows AppStudio, app without code
OpenDay 3 TIM WCap - 05/05/2016
Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
EtnaDev 2015 - Windows Bridge
Universal app ma universal per davvero
MobileDevCamp2012 - Windows Phone
Programmiamo iPhone e iPad (e non solo!) con MonoTouch
Sviluppo di applicazioni mobile cross platform
Lavorare con tile, badge e notification nelle applicazioni Windows 8
MonoTouch, un anno dopo
Push Notification: come rendere vive le app su Windows Phone
Cert04 70-484 - essentials of developing windows store apps
Introduzione alle app Windows Universal
Roadmap pubblicazione app WP7 - Community Tour 2011 DotNetUmbria
Sviluppo apps multipiattaforma con visual studio e xamarin
Push Notification, Live Tile e Background Agent
Sviluppo di applicazioni web in ambito mobile
UNIVERSAL APP IN TUTTE LE SALSE: PHONE, TABLET, PC, XBOX E IOT
Costruire applicazioni-cross-platform-con-xamarin-visual-studio-2013
Ad

Universal Store Apps - Mobile day by DotNetCampania

  • 1. Universal Store Apps Emanuele Garofalo What’s new
  • 4. Perché? Condivisioni a livello di piattaforma di sviluppo • API set • App model • Live Tiles • App distribution format • Controlli Condivisioni a livello di servizi • Un solo store • Shared app identities + entitlement • Unified Push Services (WNS) • Unified App Data Roaming and backup
  • 6. Sembra entropia…ma non lo è Serve a darti la…retro-compatibilità Windows Phone Store App Windows Store App Windows Phone Silverlight (8.1) App
  • 7. Facciamo chiarezza Store Silverlight People Hub VoIP Emulator, Geolocalization Geofencing, Accessibility, Roaming app data, A2A SSO Share contract, Background transfer Push notification service Bluetooth LE, RFComm, WiFi Direct NFC Secure Payment, Sensors, MMF (Microsoft Media Foundation), Photo e Video Capture, AND MUCH MORE Audio in Background Nuovi Controlli XAML Video editing API Automated test tools Alarm Reminder Lens App
  • 8. Creiamo una universal app in visual studio
  • 13. Novità – Punti di convergenza ControlliApp life cycle Manifest BuildDeploy App model Contratti
  • 14. Novità – Punti di convergenza Controlli App life cycle Manifest Deploy App model • L’app viene sempre ripristinata (Resume) • Le app non si chiudono con il tasto back • Le app vengono CHIUSE usanto l’app switcher
  • 15. Novità – Punti di convergenza Controlli App life cycle Manifest Deploy App model Panorama Hub LongListSelector ListView + Semantic zoom • FlipView • GridView • ListView • RichEditBox • PasswordBox • SemanticZoom
  • 16. Novità – Punti di convergenza Controlli App life cycle Manifest Deploy App model Comuni Ottimizzati per la piattaforma Specifici TextBox TextBlock Button CheckBox Date Picker Time Picker Pivot (WP) AppBar
  • 17. Punti di convergenza – Controlli ottimizzati Controlli App life cycle Manifest Deploy App model <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="20" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <TimePicker/> <DatePicker Grid.Row="2" /> </Grid>
  • 18. Novità – Punti di convergenza Controlli App life cycle Manifest Deploy App model APPX for everyone (tranne che per Silverlight) • In questo modo le risorse sono organizzate in bundle • Si riducono le dimensioni dei download • Non c’è molto da fare da parte nostra se usiamo le risorse
  • 19. Novità – Punti di convergenza Controlli App life cycle Manifest Deploy App model
  • 20. Novità – Punti di convergenza Controlli App life cycle Manifest Deploy App model
  • 21. Novità – Punti di convergenza Controlli App life cycle Manifest Deploy App model
  • 22. Novità – Punti di convergenza Controlli App life cycle Manifest Deploy App model
  • 23. Novità – Punti di convergenza Controlli App life cycle Manifest Deploy App model
  • 24. Novità – Punti di convergenza Controlli App life cycle Manifest Build Deploy App model NavigationService Frame // Simple navigation, no parameters Frame.Navigate(typeof(PaginaTarget)); // Passing a simple type, like an ID or an object Frame.Navigate(typeof(PaginaTarget), “21"); Rispetto alla navigazione basata su URI abbiamo il vantaggio di poter passare parametri di ogni tipo e non solo testuali
  • 25. Novità – Punti di convergenza Controlli App life cycle Manifest Build Deploy App model File Open Picker contract File Save Picker contract Share contract And much more…
  • 26. SHARE DALLA NOSTRA APP Demo
  • 27. Novità – Punti di convergenza Controlli App life cycle Manifest Build Deploy App model Navigation Contracts Background ScheduledTaskAgent Windows Runtime Background Tasks UserPresent , UserAway, SessionConnected, TimeZoneChange, NetworkStateChange, InternetAvailable, ServicingComplete, TimeTrigger, MaintenanceTrigger, GattCharacteristicNotificationTrigger, DeviceChangeTrigger, DeviceUpdateTrigger, RfcommConnectionTrigger, Geofencing
  • 28. Novità – Punti di convergenza Controlli App life cycle Manifest Build Deploy App model Navigation Packaging Contracts Background Geocircle circle = new Geocircle(terminiCenter, radius: 26); Geofence geofence = new Geofence(“TerminiNikeStore", circle); GeofenceMonitor.Current.Geofences.Add(geofence); //Registro il background Task BackgroundTaskBuilder builder = new BackgroundTaskBuilder(); builder.SetTrigger( new LocationTrigger( LocationTriggerType.Geofence));
  • 30. Integrazione con il Notification Center Cosa devo fare per integrarmi con il notification center? (quasi) NIENTE!
  • 31. Integrazione con il notification center //Scegliete un template ToastTemplateType toastTemplate = ToastTemplateType.ToastText02; //Recuperatene l’xml XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate); //trovate i tag text XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text"); //settate il valore dei tag toastTextElements[0].AppendChild(toastXml.CreateTextNode(toastHeading)); toastTextElements[1].AppendChild(toastXml.CreateTextNode(toastBody)); //scegliete la durata della notifica toast IXmlNode toastNode = toastXml.SelectSingleNode("/toast"); ((XmlElement)toastNode).SetAttribute("duration", "long"); //create la toast notification ToastNotification toast = new ToastNotification(toastXml); //Mostrate la toast ToastNotificationManager.CreateToastNotifier().Show(toast);
  • 32. Integrazione con il notification center Per mostrare la notifica solo nel notification center: toast.SuppressPopup = true; NB: Se l’utente scegliesse di non mostrare le vostre notifiche sarebbe tutto (ovviamente) inutile
  • 34. Integrazione con Cortana Operazione in tre step Creare il nostro file con la definizione dei comandi vocali Registrare i comandi vocali all’avvio dell’applicazione Gestire l’attivazione da comandi vocali
  • 35. Comandi Vocali <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.1"> <CommandSet xml:lang="en-us" Name="englishCommands"> <CommandPrefix> MyApp </CommandPrefix> <Example> tweet 'welcome to mobileday' </Example> <Command Name="Tweet"> <Example> tweet 'welcome to mobileday' </Example> <!-- ListenFor elements provide ways to say the command, including references to {PhraseLists} and {PhraseTopics} as well as [optional] words --> <ListenFor> tweet </ListenFor> <ListenFor> tweet {dictatedSearchTerms} </ListenFor> <Feedback> tweeting </Feedback> <!-- Navigate specifies the desired page or invocation destination for the Command--> <Navigate Target="Tweet.xaml" /> </Command> <PhraseTopic Label="dictatedSearchTerms" Scenario="Search"> <Subject> twitter </Subject> </PhraseTopic> </CommandSet> </VoiceCommands>
  • 36. Comandi Vocali string voiceCommandName; if (NavigationContext.QueryString.TryGetValue("voiceCommandName", out voiceCommandName)) { HandleVoiceCommand(voiceCommandName); } else { // If we just freshly launched this app without a Voice Command, asynchronously try to install the // Voice Commands. // If the commands are already installed, no action will be taken--there's no need to check. Task.Run(() => InstallVoiceCommands()); // Just for fun, we'll also animate the home page buttons FadeInfoButtons(true); }
  • 37. Comandi Vocali private async void InstallVoiceCommands() { try { bool using81orAbove = ((Environment.OSVersion.Version.Major >= 8) && (Environment.OSVersion.Version.Minor >= 10)); Uri vcdUri = new Uri("ms-appx:///VoiceCommandDefinition_8.1.xml"); await VoiceCommandService.InstallCommandSetsFromFileAsync(vcdUri); } catch (Exception ex) { //Gestione dell’errore } }
  • 38. Comandi Vocali void HandleVoiceCommand(string voiceCommandName) { string textToTweet = null; bool tweet = false; switch (voiceCommandName) { case "Tweet": if (NavigationContext.QueryString.TryGetValue("naturalLanguage", out phraseTopicContents) && !String.IsNullOrEmpty(phraseTopicContents)) { NavigationContext.QueryString.TryGetValue("dictatedSearchTerms", out textToTweet); SendTweet(textToTweet); } break; //…altri comandi… } }
  • 39. DA WINDOWS 8.1 A WINDOWS PHONE 8.1 Demo

Editor's Notes

  • #4: Il motivo è semplice:
  • #9: L’sdk per windows phone 8.1 introduce una nuova tipologia di progetto «Universal Apps». E’ possibile creare