Xamarin.Forms is a framework for building cross-platform applications that share most of the UI codebase among the UWP, iOS and Android platforms. Due to the higher level of abstraction compared to Xamarin.Native, Xamarin.Forms applications may suffer from memory leaks and slow rendering times at the expense of the final user experience. In the session, we will explore the mechanisms used by Xamarin.Forms to translate abstract UI components into native ones, highlight with demos what are the main bottlenecks met by developer, how to solve them and get close to native performances.
Actions on Google e Alexa skills per .NET loversLorenzo Giudici
Evento #Aperitech 05/11/2019 organizzato da Codemotion.
Ospite: la community di Milano Chatbots con 5 talk per illustrare lo stato dell'arte dei chatbot e dei voicebot.
1° Talk tecnico:
"Google Home", "Alexa", "Skills", "Smart speaker"… ne sentiremo parlare (tanto) anche nel 2020 e noi sviluppatori .NET possiamo cavalcare l'onda perchè abbiamo tutti gli strumenti e le competenze necessarie.
VIDEO: https://youtu.be/tboHO_mj2uM
DotNetCampus - Continuous Integration con Sql ServerAlessandro Alpi
Continuous Integration con SQL Server. Come automatizzare i processi di build e di test su database SQL Server. Come includere SQL Server nei processi di Application Lifecycle Management (Database Lifecycle Management).
Sessione per NetCampus 2015. La diffusione sempre più ampia di applicazioni sviluppate interamente in HTML5 e JS richiede l'adozione di processi di automazione per la fase di build, testing e rilascio. In questa sessione vedremo quali sono i principali strumenti a nostra disposizione per semplificare queste fasi dello sviluppo.
Introduction to Blazor and WebAssembly in Christmas sauce. In this session we will see how to create a small demonstration application to send Christmas greetings.
Prepariamoci al cambiamento. ASP.NET MVC e ASP.NET Web API saranno unificati in un unico framework chiamato ASP.NET MVC 6, e questo è solo la prima di una serie di novità che stanno per arrivare.
Tutto si semplifica. Le performance migliorano. Un altro salto tecnologico in avanti portato da ASP.NET 5.
In questa sessione, infatti, vedremo tutte le novità che ASP.NET MVC 6 porta con se, e cercheremo di andare in dettaglio in modo da capire cosa voglia dire realizzare (da zero) o migrare (un'applicazione essitente) a questa nuova versione
Dependency injection questa sconosciutaAndrea Dottor
L'uscita di ASP.NET Core ha portato a una maggiore diffusione dell'utilizzo della DI (Dependency Injection) ma spesso senza che lo sviluppatore sappia la sua reale utilità o potenzialità.
Dependency Injection, uno dei design pattern della programmazione OOP. Una best-practice dello sviluppo che può portare alla semplificazione del codice scritto, facilitare il disacoppiamento, e migliorare la testabilità.
In questa sessione vedremo cos'è la DI e come utilizzarla intelligentemente all'interno dei nostri progetti.
Slide dell'evento "XE One Day - Good code" tenuto il 15.09.2018.
Il codice è disponibile alla pagina dell'evento https://www.xedotnet.org/eventi/one-day-good-code/
ARCHITETTURA DI UN'APPLICAZIONE SCALABILEDotNetCampus
Questa sessione tratterà delle implementazioni di architetture robuste e scalabili, in scenari di sviluppo applicativi rientranti nella tipologia dei Software as a Service. In particolare vedremo come accopiare le feature e le necessità del SaaS con servizi propri presenti su Azure; con focus su web, servizi mobili, data, e notification.
Intelligenza artificiale nel mondo front-end - CodeGen2021Michele Aponte
Le applicazioni dell'intelligenza artificiale sono tantissime e ci permettono di andare a risolvere specifici problemi per dare valore alle nostre soluzioni: proviamo a immaginare una nuova User eXperience per le nostre applicazioni business che vada oltre pagine e forms e che sfrutti nuove tipologie di interazioni rese possibili dalle applicazioni della IA.
APPSTUDIO: DA ZERO ALLO STORE IN 50 MINUTI!DotNetCampus
AppStudio e' un ambiente RAD web based per lo sviluppo di Universal App (Windows Phone 8.1 e Windows 8.1) per la visualizzazioni di sorgenti dati. In questa sessione vedremo come sia facile realizzare da zero un'app che acceda a sorgenti remote e come sia, infine, possibile personalizzare il codice sorgente per poter implementare le proprie personalizzazioni.
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...Codemotion
L’Application Economy obbliga l’IT a correre alla stessa velocità del business. Nel contempo l’entrata in vigore di nuove stringenti normative in ambito sicurezza impone l’adeguamento del Software Delivery LifeCycle affinché queste possano essere implementate e testate già dalle fasi iniziale dello sviluppo, ottimizzando i tempi di delivery e minimizzando il time to market.
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017Codemotion
Cyber: the final frontier, the place where government units and military intelligence are fighting a new kind of war. From total warfare to cyber warfare, from cyber crime to cyber terrorism, talking about intelligence and offensive based approaches, government malwares, big data repositories, 0-day brokering, attacks to nuclear implants, power plants and air carriers, we'll do a quick tour inside this new world, full of opportunities, contenders, lies and real amazing stories...
Actions on Google e Alexa skills per .NET loversLorenzo Giudici
Evento #Aperitech 05/11/2019 organizzato da Codemotion.
Ospite: la community di Milano Chatbots con 5 talk per illustrare lo stato dell'arte dei chatbot e dei voicebot.
1° Talk tecnico:
"Google Home", "Alexa", "Skills", "Smart speaker"… ne sentiremo parlare (tanto) anche nel 2020 e noi sviluppatori .NET possiamo cavalcare l'onda perchè abbiamo tutti gli strumenti e le competenze necessarie.
VIDEO: https://youtu.be/tboHO_mj2uM
DotNetCampus - Continuous Integration con Sql ServerAlessandro Alpi
Continuous Integration con SQL Server. Come automatizzare i processi di build e di test su database SQL Server. Come includere SQL Server nei processi di Application Lifecycle Management (Database Lifecycle Management).
Sessione per NetCampus 2015. La diffusione sempre più ampia di applicazioni sviluppate interamente in HTML5 e JS richiede l'adozione di processi di automazione per la fase di build, testing e rilascio. In questa sessione vedremo quali sono i principali strumenti a nostra disposizione per semplificare queste fasi dello sviluppo.
Introduction to Blazor and WebAssembly in Christmas sauce. In this session we will see how to create a small demonstration application to send Christmas greetings.
Prepariamoci al cambiamento. ASP.NET MVC e ASP.NET Web API saranno unificati in un unico framework chiamato ASP.NET MVC 6, e questo è solo la prima di una serie di novità che stanno per arrivare.
Tutto si semplifica. Le performance migliorano. Un altro salto tecnologico in avanti portato da ASP.NET 5.
In questa sessione, infatti, vedremo tutte le novità che ASP.NET MVC 6 porta con se, e cercheremo di andare in dettaglio in modo da capire cosa voglia dire realizzare (da zero) o migrare (un'applicazione essitente) a questa nuova versione
Dependency injection questa sconosciutaAndrea Dottor
L'uscita di ASP.NET Core ha portato a una maggiore diffusione dell'utilizzo della DI (Dependency Injection) ma spesso senza che lo sviluppatore sappia la sua reale utilità o potenzialità.
Dependency Injection, uno dei design pattern della programmazione OOP. Una best-practice dello sviluppo che può portare alla semplificazione del codice scritto, facilitare il disacoppiamento, e migliorare la testabilità.
In questa sessione vedremo cos'è la DI e come utilizzarla intelligentemente all'interno dei nostri progetti.
Slide dell'evento "XE One Day - Good code" tenuto il 15.09.2018.
Il codice è disponibile alla pagina dell'evento https://www.xedotnet.org/eventi/one-day-good-code/
ARCHITETTURA DI UN'APPLICAZIONE SCALABILEDotNetCampus
Questa sessione tratterà delle implementazioni di architetture robuste e scalabili, in scenari di sviluppo applicativi rientranti nella tipologia dei Software as a Service. In particolare vedremo come accopiare le feature e le necessità del SaaS con servizi propri presenti su Azure; con focus su web, servizi mobili, data, e notification.
Intelligenza artificiale nel mondo front-end - CodeGen2021Michele Aponte
Le applicazioni dell'intelligenza artificiale sono tantissime e ci permettono di andare a risolvere specifici problemi per dare valore alle nostre soluzioni: proviamo a immaginare una nuova User eXperience per le nostre applicazioni business che vada oltre pagine e forms e che sfrutti nuove tipologie di interazioni rese possibili dalle applicazioni della IA.
APPSTUDIO: DA ZERO ALLO STORE IN 50 MINUTI!DotNetCampus
AppStudio e' un ambiente RAD web based per lo sviluppo di Universal App (Windows Phone 8.1 e Windows 8.1) per la visualizzazioni di sorgenti dati. In questa sessione vedremo come sia facile realizzare da zero un'app che acceda a sorgenti remote e come sia, infine, possibile personalizzare il codice sorgente per poter implementare le proprie personalizzazioni.
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...Codemotion
L’Application Economy obbliga l’IT a correre alla stessa velocità del business. Nel contempo l’entrata in vigore di nuove stringenti normative in ambito sicurezza impone l’adeguamento del Software Delivery LifeCycle affinché queste possano essere implementate e testate già dalle fasi iniziale dello sviluppo, ottimizzando i tempi di delivery e minimizzando il time to market.
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017Codemotion
Cyber: the final frontier, the place where government units and military intelligence are fighting a new kind of war. From total warfare to cyber warfare, from cyber crime to cyber terrorism, talking about intelligence and offensive based approaches, government malwares, big data repositories, 0-day brokering, attacks to nuclear implants, power plants and air carriers, we'll do a quick tour inside this new world, full of opportunities, contenders, lies and real amazing stories...
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...Codemotion
Mostrare come il game audio è a tutti gli effetti una professionalità che unisce ad aspetti artistico creativi, forti competenze tecnico informatiche. L'audio designer può a tutti gli effetti considerarsi un ingegnere del suono, che applica modelli, regole e metodi rigorosi per ottenere il risultato. Tutto questo all'interno del ciclo di produzione, integrandosi con grafici, designer e programmatori
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...Codemotion
Virtual Reality is an undoubtedly ideal storytelling platform, whichever the story. After starting with the very first VR comic in the world, "Magnetique", a GearVR exclusive, we'll focus on telling virtual reality stories without resorting to 360° videos. Drawing techniques, stereoscopic coding, sequential art tips and tricks. And more. Our times allow for a unique opportunity to tell old stories, anew.
Anche per te "Open Source" = "qualcuno ha già fatto il lavoro al posto mio, e per di più gratis"? Ottimo, allora sei nel posto giusto e con l'approccio giusto! In questo talk, attraverso tanti episodi di vita vissuta come utente, contributor e maintainer, discuteremo di come trarre una serie di altri vantaggi da questo magico mondo, di come approcciarsi alle community e, perché no, anche delle gioie e dei dolori che ti aspettano se decidi di saltare la staccionata e di rendere (veramente) open il tuo codice.
Docker Inside/Out: the ‘real’ real-world of stacking containers in production...Codemotion
So you’ve already containerized the shit out of your code, broken down monoliths, microserviced the hell out of your app and have run some awesome workloads in your local, dev and test environments. It’s all looking good, but now what? Running Docker commands is one thing, but maintaining containers in production is a whole other ballgame. So, during this talk, I’ll show you the REAL wild world of Docker in production. With the added benefit of talking to and observing how over 900 of our customers have been using Docker in production.
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017Codemotion
L’ecosistema degli orchestratori di container è in rapido movimento, una galassia di piattaforme e framework. Come si fa a scegliere quello giusto per le vostre esigenze? Vediamo tutti gli orchestratori in commercio, con i loro pro e contro: DC/OS, Kubernetes, Docker e anche quelli meno famosi ma saranno promesse, e anche le dinamiche e le scelte fatte.
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...Codemotion
Vast volume of our processed data is Time Series data and once you start working with distributed systems, you start tackling many scale and performance problems: How to handle missing data?Should I handle both serving and backed process or separating them out? Best Performance for Money? In the talk we will tell the tale of all of the transformations we’ve made to our data model@Windward, some of the problems we’ve handled, review the multiple data persistency layers like: S3, MongoDB, Apache Cassandra, MySQL. And I’ll try my best NOT to answer the question “Which one of them is the Best?"
Barbarians at the Gate(way) - Dave Lewis - Codemotion Rome 2017Codemotion
This talk will examine the tools, methods and data behind the DDoS attacks that are prevalent in the news headlines. Using information collected, I will demonstrate what the attackers are using to cause their mischief and mayhem and examine the timeline and progression of attackers as they move from the historical page defacers to the motivated DDoS attacker. I will look at the motivations and rationale that they have and try to share some sort of understanding as to what patterns to be aware of for their own protection.
Cyber Security in Multi Cloud Architecture - Luca Di Bari - Codemotion Rome 2017Codemotion
Nuovi modelli di sicurezza in ambienti multi-cloud. Ridefinizione del concetto di Front-End. Nuovi approcci alle tematiche di sicurezza in scenari magmatici.
Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...Codemotion
In a world of connected devices it is really important to be prepared receiving and managing a huge amount of messages. In this context what is making the real difference is the backend that has to be able to handle safely every request in real time. In this talk we will show how the broad spectrum of highly scalable services makes Google Cloud Platform the perfect habitat for such as workloads.
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...Codemotion
Continuiamo il viaggio iniziato lo scorso anno nel magico mondo della moderna programmazione del Commodore 64. La scena italiana e romana è molto attiva. Dopo una brevissima introduzione sugli sprite in generale, il mitico Andrea Pompili, autore dello sparattutto Catalypse pubblicato da Genias nel 1992, ci spiegherà la tecnica dello sprite multiplexing, utilizzata per superare il noto limite degli 8 sprite contemporanei a schermo, applicata al suo gioco.
An Introduction to Apache Ignite - Mandhir Gidda - Codemotion Rome 2017Codemotion
Apache Ignite is a high-performance, integrated and distributed in-memory platform for computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with traditional disk-based or flash technologies.
The busy developer guide to Docker - Maurice de Beijer - Codemotion Rome 2017Codemotion
Docker is all the rage these days and you are told all the time you need to use Docker to host your applications. But what is Docker and why has it become such a hot topic? Why is Microsoft updating Windows 2016 so be a Docker container host? What does using Docker mean for your application architecture or can you just take any application and host it using Docker? In this session Maurice de Beijer will explain the history of Docker as well as explain how you could use it with your applications. He will also explain what else, besides Docker, you will need to add to your architecture.
Component-Based UI Architectures for the Web - Andrew Rota - Codemotion Rome...Codemotion
Today UI frameworks for the web are embracing the concept of “components”. But what does a component-focused architecture really mean? In this talk we’ll dive into the theory behind component-based UIs and what it means for the future of user interfaces on the web. At the conclusion of this talk, attendees will have an understanding of what makes component-based architectures distinct, and why such an approach might be the ideal solution for building web-based UIs.
Meetup Code Garden Roma e Java User Group Roma: metodi asincroni con Spring -...Codemotion
Possiamo scrivere metodi asincroni anche in Java e con Spring, anche senza dover usare le ultime versioni della JVM o del framework. Si parlerà di thread bloccati e altri stati del thread. Le interfacce Executor della JDK ci aiutano a gestire le chiamate asincrone; vedremo come vengono implementate in Spring. Ci saranno esempi di configurazioni XML e con annotations. Si parlerà di callback hell e di come evitarlo usando la Completable Future.
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...Codemotion
Once you start working with Big Data systems, you discover a whole bunch of problems you won’t find in monolithic systems. Monitoring all of the components becomes a big data problem itself. In the talk, we’ll mention all of the aspects that you should take into consideration when monitoring a distributed system using tools like Web Services, Spark, Cassandra, MongoDB, AWS. Not only the tools, what should you monitor about the actual data that flows in the system? We’ll cover the simplest solution with your day to day open source tools, the surprising thing, that it comes not from an Ops Guy.
Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...Codemotion
Most React-Redux applications store the work in progress as is in a database. It is fine to treat objects like this in a small application. But this is not optimal when applications are complex. Prefer the CQRS design pattern for more complex applications. Combining this with Event-Sourcing is an even more powerful solution. Event-Sourcing ensures that every action is stored as a separate domain event. These domain events are the CQRS write model. These events also project into a secondary database. This projection builds the CQRS read model for the application.
If you implement a microservice architecture correctly, you will end up with a proliferation of different microservices; with multiple instances of each one for redundancy. Find out how you to get microservices to automatically discover each other, share a configuration with real-time updates. See how to eliminate server management altogether with "serverless" microservice frameworks.
Abstract:
* Introduzione a Seam ;
* Ciclo di vita di Seam;
* Component and context;
* Absolute Inversion of Control;
* Rapid Seam development (con esempio di start-up su eclipse o se si preferisce a linea di comando);
* Differenze sostanziali con la versione 3.0 / Ajax and Javascript remoting
XeDotNet meeting del 5 Marzo 2013
In questa sessione vedremo come Knockout.js permetta di scrivere codice JavaScript in modo pulito e organizzato, semplificando la scrittura del codice e la sua manutenzione. Come lo si utilizza KO? Quali vantaggi ci offre? Quali librerie ci vengono in aiuto? Quali sarebbe meglio evitare?
Community Tour 2010 - CMS Edition
DotNetMarche
Slides relative alla seconda sessione su Orchard: principi di base sulla customizzazione di temi e layout.
In questa sessione faremo una panoramica a 360 gradi su Blazor, la nuovissima tecnologia Microsoft nata da una (geniale :-) idea di Steve Sanderson per lo sviluppo di applicazioni Web client basate su WebAssembly.
Nell'introduzione parlemermo brevemente di WebAssembly, spiegando di cosa si tratta e del perché questa tecnologia abbia tutte le premesse per portare uno dei più grandi "disruptive changes" nel modo di sviluppare applicazioni Web client. Passeremo poi a Blazor esaminandone prima gli aspetti architetturali e procedendo con un behind the scenes per svelare in che modo avviene la "magia" dell'interazione con il browser. Verranno poi presentate le feature che questa tecnologia offre (template project su VS, components, layouts, binding, dependency injection, hosting) sia attraverso slides che, di pari passo, con delle demo di un'applicazione funzionante realizzata in Blazor. Vedremo poi quali sono le problematiche legate a performance, deployment e distribuzione parlando delle possibili future ottimizzazioni. Infine chiuderemo con un confronto tra Blazor e i maggiori framework ora in uso per lo sviluppo di applicazioni Web client (Angular, Vue, Knockout, ecc.) e con alcune considerazioni sull'impatto che Blazor e tecnologie simili potrebbe avere a cascata per lo sviluppo Web futuro, in una sorta di "butterfly effect" nel mondo Web client.
Enterprise Spring and Flex applicationsmarcocasario
SpringSource ha recentemente annunciato Spring BlazeDS Integration, un nuovo progetto open source per permettere una facile integrazione tra il framework Spring e Adobe BlazeDS, una tecnologia open source basata su server Java remoting e Web messaging.
Il plugin di SpringSource fornisce un approccio più semplice ed intuitivo agli sviluppatori Spring e Java per creare Enterprise Rich Internet Applications utilizzando il framework Adobe Flex, una pietra miliare della Flash Platform.
In questa sessione ai partecipanti verrà fornita una panoramica del framework Flex e di BlazeDS, illustrando i vantaggi e le modalità di integrazione al framework Spring attraverso il plugin Spring BlazeDS.
Joomla! 1.5: CMS a mani tese verso gli sviluppatoriGrUSP
Joomla! è un CMS ritenuto troppo spesso una soluzione esclusivamente for dummies : in questo intervento cercheremo di sfatare questa convinzione andando ad analizzare le feature che la versione 1.5 ha “introdotto” a favore degli sviluppatori.
Verranno proposte, per ogni capitolo del talk, slide introduttive e di approfondimento, concludendo con un case study per ogni tematica proposta.
Obiettivo del talk sarà quello di comprendere quanto Joomla! sia una soluzione che offre grandi vantaggi fondendo abbattimento di costi, elevata relazionabilità con il cliente finale e buona estendibilità per le esigenze dello sviluppatore.
Un breve talk per introdurre ad alcune funzioni native di Joomla! ( e del suo framework ) che ci permettono di riconsiderare il CMS a liverllo di sviluppo.
Similar to Xamarin.Forms Performance Tips & Tricks - Francesco Bonacci - Codemotion Rome 2017 (20)
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Codemotion
Increased complexity makes it very hard and time-consuming to keep your software bug-free and secure. We introduce fuzz-testing as a method for automatically and continuously discovering vulnerabilities hidden in your code. The talk will explain how fuzzing works and how to integrate fuzz-testing into your Software Development Life Cycle to increase your code’s security.
Pompili - From hero to_zero: The FatalNoise neverending storyCodemotion
It was 1993 when we decided to venture in a beat'em up game for Amiga. The Catalypse's success story pushed me and my comrade to create something astonishing for this incredible game machine... but things went harder, assumptions were slightly different, and italian competitors appeared out of nowhere... the project died in 1996. Story ended? Probably not...
Il Commodore 65 è un prototipo di personal computer che Commodore avrebbe dovuto mettere in commercio quale successore del Commodore 64. Purtroppo la sua realizzazione si fermò appunto allo stadio prototipale. Racconterò l'affascinante storia del suo sviluppo ed il perchè della soppressione del progetto ormai ad un passo dalla immissione in commercio.
Rivivere l'ebbrezza di progettare un vecchio computer o una consolle da bar è oggi possibile sfruttando le FPGA, ovvero logiche programmabili che consentono a chiunque di progettare il proprio hardware o di ricrearne uno del passato. In questa sessione si racconta come dal reverse engineering dell'hardware di vecchie glorie come il Commodore 64 e lo ZX Spectrum sia stato possibile farle rivivere attraverso tecnologie oggi alla portata di tutti.
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Codemotion
There's a lot of talk about blockchain, but how does the technology behind it actually work? For developers, getting some hands-on experience is the fastest way to get familiair with new technologies. So let's build a blockchain, then! In this session, we're going to build one in plain old Java, and have it working in 40 minutes. We'll cover key concepts of a blockchain: transactions, blocks, mining, proof-of-work, and reaching consensus in the blockchain network. After this session, you'll have a better understanding of core aspects of blockchain technology.
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Codemotion
When was the last time you were truly lost? Thanks to the maps and location technology in our phones, a whole generation has now grown up in a world where getting lost is truly a thing of the past. Location technology goes far beyond maps in the palm of our hand, however. In this talk, we will explore how a ridesharing app works. How do we discover our destination?How do we find the closest driver? How do we display this information on a map? How do we find the best route?To answer these questions,we will be learning about a variety of location APIs, including Maps, Positioning, Geocoding etc.
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Codemotion
Eward Driehuis, SecureLink's research chief, will guide you through the bumpy ride we call the cyber threat landscape. As the industry has over a decade of experience of dealing with increasingly sophisticated attacks, you might be surprised to hear more attacks slip through the cracks than ever. From analyzing 20.000 of them in 2018, backed by a quarter of a million security events and over ten trillion data points, Eward will outline why this happens, how attacks are changing, and why it doesn't matter how neatly or securely you code.
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 - Codemotion
IoT revolution is ended. Thanks to hardware improvement, building an intelligent ecosystem is easier than never before for both startups and large-scale enterprises. The real challenge is now to connect, process, store and analyze data: in the cloud, but also, at the edge. We’ll give a quick look on frameworks that aggregate dispersed devices data into a single global optimized system allowing to improve operational efficiency, to predict maintenance, to track asset in real-time, to secure cloud-connected devices and much more.
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Codemotion
What if Virtual Reality glasses could transform your environment into a three-dimensional work of art in realtime in the style of a painting from Van Gogh? One of the many interesting developments in the field of Deep Learning is the so called "Style Transfer". It describes a possibility to create a patchwork (or pastiche) from two images. While one of these images defines the the artistic style of the result picture, the other one is used for extracting the image content. A team from TNG Technology Consulting managed to build an AI showcase using OpenCV and Tensorflow to realize such goggles.
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Codemotion
Blockchain (and Cryptocurrency) is an evolution of 20-year old research from scientists like Chaum, Lamport, and Castro & Liskov. Due to the current hype, it's hard to distinguish beneficial aspects of the technology from a desire for a "silver bullet" for device security, verifiable logistics, or "saving democracy". The problem: blockchain introduces new security challenges - and blind adoption without understanding reduces overall security. In this talk, Melanie Rieback and Klaus Kursawe explain the pitfalls and limits of blockchain, so you can avoid making your applications LESS secure.
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Codemotion
Networking is a core part of computing in the digital world we inhabit. But, how well do you know how it works? Do you understand all the moving parts of the OSI stack inside your computer, and how the network is actually put together? How can this ever work? This guided safari of layers, standards, protocols, and happenstance will bring us close to the copper wire, and up through the layers of CDMA/CD, ARP, routing and HTTP. We will make a few excursions through patchworks that still work forty years later, and cleverly designed mechanisms that show that simplicity is the only way to last.
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Codemotion
Performance tests are not only an important instrument for understanding a system and its runtime environment. It is also essential in order to check stability and scalability – non-functional requirements that might be decisive for success. But won't my cloud hosting service scale for me as long as I can afford it? Yes, but… It only operates and scales resources. It won't automatically make your system fast, stable and scalable. This talk shows how such and comparable questions can be clarified with performance tests and how DevOps teams benefit from regular test practise.
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Codemotion
Sascha will demonstrate the opportunities and challenges of Conversational AI learned from the practice. Both Technology and User Experience will be covered introducing a process finding micro-moments, writing happy paths, gathering intents, designing the conversational flow, and finally publishing on almost all channels including Voice Services and Chatbots. Valuable for enterprises, developers, and designers. All live on stage in just minutes and with almost no code.
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Codemotion
A key challenge we face at Pacmed is quickly calibrating and deploying our tools for clinical decision support in different hospitals, where data formats may vary greatly. Using Intensive Care Units as a case study, I’ll delve into our scalable Python pipeline, which leverages Pandas’ split-apply-combine approach to perform complex feature engineering and automatic quality checks on large time-varying data, e.g. vital signs. I’ll show how we use the resulting flexible and interpretable dataframes to quickly (re)train our models to predict mortality, discharge, and medical complications.
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Codemotion
Coolblue is a proud Dutch company, with a large internal development department; one that truly takes CI/CD to heart. Empowerment through automation is at the heart of these development teams, and with more than 1000 deployments a day, we think it's working out quite well. In this session, Pat Hermens (a Development Managers) will step you through what enables us to move so quickly, which tools we use, and most importantly, the mindset that is required to enable development teams to deliver at such a rapid pace.
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...Codemotion
Quantum computers can use all of the possible pathways generated by quantum decisions to solve problems that will forever remain intractable to classical compute power. As the mega players vie for quantum supremacy and Rigetti announces its $1M "quantum advantage" prize, we live in exciting times. IBM-Q and Microsoft Q# are two ways you can learn to program quantum computers so that you're ready when the quantum revolution comes. I'll demonstrate some quantum solutions to problems that will forever be out of reach of classical, including organic chemistry and large number factorisation.
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Codemotion
Chinese food exploded across America in the early 20th century, rapidly adapting to local tastes while also spreading like wildfire. How was it able to spread so fast? The GY6 is a family of scooter engines that has achieved near total ubiquity in Europe. It is reliable and cheap to manufacture, and it's made in factories across China. How are these factories able to remain afloat? Chinese-American food and the GY6 are both riveting studies in product-market fit, and both are the product of a distributed open source-like development model. What lessons can we learn for open source software?
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Codemotion
The design space has exploded in size within the last few years and Sketch is one of the most important milestones to represent the phenomenon. But behind the scenes of this growing reality there is a remote team that revolutionizes the design space all without leaving the home office. This talk will present how Sketch has grown to become a modern, product designer's tool.
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Codemotion
Would you fly in a plane designed by a craftsman or would you prefer your aircraft to be designed by engineers? We are learning that science and empiricism works in software development, maybe now is the time to redefine what “Software Engineering” really means. Software isn't bridge-building, it is not car or aircraft development either, but then neither is Chemical Engineering. Engineering is different in different disciplines. Maybe it is time for us to begin thinking about retrieving the term "Software Engineering" maybe it is time to define what our "Engineering" discipline should be.
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Codemotion
What is the job of a CTO and how does it change as a startup grows in size and scale? As a CTO, where should you spend your focus? As an engineer aspiring to be a CTO, what skills should you pursue? In this inspiring and personal talk, I describe my journey from early Red Hat engineer to CTO at Bloomon. I will share my view on what it means to be a CTO, and ultimately answer the question: Should the CTO be coding?
3. @xamarinhq lo adora, lo sviluppatore lo
teme e il cliente lo odia...
Forse un pò mal giudicato.. È davvero
sempre colpa del framework?
Il dilemma degli ultimi tempi assieme a
PCL vs. SP
O odia voi?
Vediamo come risolvere!
4. 1. Native vs. Forms
2. XamlC
3. View
4. Layout
5. Binding
6. UI Thread
7. Forms Embedding
5.
6. iOS C# UI Windows C# UIAndroid C# UI
Shared C# Mobile
C# Wrapper per l’accesso
ad API native
Riutilizzo codebase comune
Performance ~ Approccio Silo
Progetto della UI dipendente da tool e
modalità native
7. Shared C# Mobile
Xamarin.Forms
Xaml/C# UI codebase
API di Sistema astratte
Data Binding e MVVM
Performance < Xamarin.Native
8. Xamarin.Forms non è adatto a tutti i tipi di app
OK per applicazioni di utilità o data-entry
x Non ideale se l’obiettivo finale è produrre effetti grafici sfavillanti
Primo approccio affrontato per chi viene dal mondo WPF, WinRT, UWP
ecc. Occorrerebbe prima conoscere quello che c’è sotto...
Spesso usato da team per la prima fase di prototipaggio
dell’applicazione Poi se il cliente non è contento si passa a Native…
MA se ci facciamo bastare quello che offre Xamarin.Forms?
9. Xamarin.Forms non è da sottovalutare:
Si possono creare UI accattivanti e anche complesse
github.com/xamarinhq/app-evolve
10. Xamarin.Forms non è da sottovalutare:
Si possono creare UI accattivanti e anche complesse
Si evita di replicare il codice della UI
github.com/xamarinhq/app-evolve
iOS Android UWP
*Statistiche prese dall’app
Xamarin Evolve 2016
Codice
cross-platform
11. Xamarin.Forms non è da sopravvalutare:
Occorre tener conto dell’ulteriore Layer di astrazione
E’ un framework ancora giovane
Lo XAML non è lo stesso di UWP…
Non si può pensare di sviluppare una pagina Forms senza sapere quello
che c’è sotto!
A volte l’unica cosa da fare è utilizzare bit nativi - aka Custom Renderer
ed Effect
12. Nel progettare la UI con Xamarin.Forms bisogna:
Utilizzare i controlli più adatti per lo scenario in mente
Non eccedere con la densità dell’albero visuale (Visual Tree)
Sfruttare a proprio vantaggio le funzionalità (nascoste) di Xamarin
L’HW dell’utente medio è pessimo Prendere come riferimento la
fascia medio-bassa
Avere buon senso…
… E seguire le prossime linee guida
13.
14. XamlCompilationOptions
Compile Skip
Compilazione AOT (in CIL) Compilazione JIT
Se si utilizza XAML per la UI si può specificare la modalità di compilazione:
Velocizza il caricamento degli
elementi visuali
Riduce la dimensione del
pacchetto finale
Tempi di compilazione più lunghi
Valore di default per garantire
retro compatibilità
Nessuna validazione dello XAML
compile-time
15. A livello di Assembly
E’ buona prassi
farlo nel file
AssemblyInfo.cs
A livello di Pagina
20. Una View in Forms rappresenta un nodo
nell’albero della pagina (Visual Tree) avente
proprietà visuali ed un comportamento
21. Una View in Forms rappresenta un nodo
nell’albero della pagina (Visual Tree) avente
proprietà visuali ed un comportamento
Rappresenta l’elemento di più basso
livello, assieme a Page, nella gerarchia di
ereditarietà di Xamarin.Forms
Esempi: Label, Editor, Button, Image…
22. La creazione di una View in Xamarin.Forms è suddivisa in due fasi:
Inflating
Istanziamento della View
Rendering
Aggiunta all’albero visuale
(Automatica in Xaml)public MainPage()
{
var stackLayout = new StackLayout();
stackLayout.Children.Add(new Label() {
Text = "Hello Codemotion!"
});
//...
}
public MainPage()
{
//...
Content = stackLayout;
}
23. Evitare di usare trasparenza e opacità, specialmente in Android
Preferire le Bindable Property TranslationX e TranslationY, piuttosto
che Padding e Margin, per eseguire riordinamenti post-layout
Non specificare i valori di default delle proprietà visuali, specialmente
VerticalOptions e HorizontalOptions Vengono scatenati cicli di
misura superflui
24. Per far seguire porzioni di testo con caratteristiche diverse preferire la
Bindable Property FormattedText di Label
<StackLayout Orientation="Horizontal">
<Label Text="Hello"
TextColor="Blue"/>
<Label Text="Codemotion!"
TextColor="Orange"/>
</StackLayout>
<Label>
<Label.FormattedText>
<FormattedString>
<Span Text="Hello "
ForegroundColor="Blue"/>
<Span Text="Codemotion!"
ForegroundColor="Orange" />
</FormattedString>
</Label.FormattedText>
</Label>
25. Le Bindable Property VerticalTextAlignment e HorizontalTextAlignment di
tipo TextAlignment sono ottimizzate per posizionare elementi visuali di
tipo Label
<Label Text="Hello Codemotion!"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<Label Text="Hello Codemotion!"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"/>
27. Disabilitare Opacità
Problematiche in Android e.g. JPG CMYK non supportati
Da preferire downscaling e manipolazione server-side
<Image IsOpaque="False"/>
Eventualmente non
reinventare la ruota…
<ffimageloading:CachedImage LoadingPlaceholder="loading.png"
DownsampleToViewSize="True">
<ffimageloading:CachedImage.Transformations>
<ffimageloading:GrayscaleTransformation />
</ffimageloading:CachedImage.Transformations>
</ffimageloading:CachedImage>
github.com/luberda-molinet/FFImageLoading
28. Problematiche fino all’introduzione di una strategia di caching delle celle in
Xamarin.Forms 2.0
public class CustomListView : ListView
{
public CustomListView(ListViewCachingStrategy cachingStrategy) :
base(cachingStrategy) { //... }
}
<ListView CachingStrategy="RecycleElement"/>
var listView = new ListView(
ListViewCachingStrategy.RecycleElement);
Se controllo custom, esporre il costruttore della classe base
29. ListViewCachingStrategy
RecycleElement RetainElement
La ListView mantiene un pool di
celle di dimensione pari alla
finestra visuale di scorrimento
(Cell Recycling)
Ideale se il layout delle celle è
statico Ad esempio se non si
utilizzano DataTemplateSelector
Valore di default per garantire
retrocompatibilità
La ListView genera una nuova
cella per ogni elemento della
lista (Cell Retention)
Ideale se si utilizza un alto
numero di Binding
30. Preferire IList<T> anziché IEnumerable<T> come sorgente ItemsSource
della ListView Supporto ad accesso casuale
Se si utilizza RecycleElement come strategia di Caching, rimuovere i
Binding della cella ed aggiornarli nell’handler OnBindingContextChanged
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
var item = BindingContext as ItemViewModel;
if (item != null)
{
item.Title = TitleLabel.Text;
}
}
31. <ScrollView>
<StackLayout>
<Label Text="Header" />
<ListView />
<Label Text="Footer" />
</StackLayout>
</ScrollView>
Per abilitare lo scrolling all’interno di pagine contenenti ListView
utilizzare i DataTemplate
<ListView Header="Header" Footer="Footer">
<ListView.HeaderTemplate>
<DataTemplate>
<Label Text="{Binding .}" />
</DataTemplate>
</ListView.HeaderTemplate>
<ListView.FooterTemplate>
<DataTemplate>
<Label Text="{Binding .}" />
</DataTemplate>
</ListView.FooterTemplate>
</ListView>
HeaderTemplate e FooterTemplate
32.
33. Un Layout in Forms rappresenta un nodo
nell’albero della pagina avente proprietà
visuali e un comportamento
È responsabile della posizione e dimensione
dei suoi nodi figlio
34. Eredita da VisualElement, Element ma non
da View
Esempi: Grid, StackLayout, AbsoluteLayout...
Un Layout in Forms rappresenta un nodo
nell’albero della pagina avente proprietà
visuali e un comportamento
È responsabile della posizione e dimensione
dei suoi nodi figlio
35. La creazione e l’aggiornamento di un Layout in Xamarin.Forms attraversano
due fasi (o cicli):
Invalidation Cycle (IC)
Dal nodo di più basso livello, si
notifica ricorsivamente il nodo padre
dell’invalidazione (aggiornamento)
del proprio Layout
Ha termine una volta raggiunto il
nodo radice (e.g. Page) o se il padre
decide di ignorare l’invalidazione
Layout Cycle (LC)
A seguito dell’invalidazione e
procedendo top-bottom, la pagina
riorganizza il layout degli elementi
etichettati come "invalidati"
La riorganizzazione termina con
l’ultimo elemento invalidato
37. public enum InvalidationTrigger {
Undefined = 0,
MeasureChanged = 1 << 0,
HorizontalOptionsChanged = 1 << 1,
VerticalOptionsChanged = 1 << 2,
SizeRequestChanged = 1 << 3,
RendererReady = 1 << 4,
MarginChanged = 1 << 5
}
L’invalidazione di un Layout può essere
causata da diversi fattori Indicati
dall’enumerativo InvalidationTrigger
Ogni Layout può decidere di gestire a
suo modo l’invalidazione di un figlio,
eventualmente interrompendo il ciclo di
invalidazione
Lo sviluppatore può sfruttare
l’interruzione di Layout di sistema
(anche implementando il proprio)
per guadagnare ms sull’IC
39. Il Layout Cycle termina con il Layout() dell’ultimo elemento invalidato
L’implementazione dei metodi Measure e Layout è demandata ai
Custom Renderer specifici per il Layout
Diversamente dall’Invalidation Cycle, non è possibile controllare il
ciclo di Layout
40. Se si definisce una View da codice, è bene aggiungere la View
contenitore all’albero visuale solo quando si è finito di manipolare la
struttura delle sue subview Altrimenti ulteriori cicli di Misure
Aggiungere View al VT nel costruttore e non in OnAppering()
Altrimenti ulteriori cicli di Invalidazione
Non utilizzare ForceLayout()
Non sostituire ListView con ScrollView+StackLayout Nessuna
virtualizzazione delle subview
41. Grid organizza il layout dei suoi figli in celle individuate da Righe e Colonne
Permette di creare Layout composti senza eccessivo
nesting
Occorre prestare attenzione all’utilizzo di Righe e
Colonne per il dimensionamento
42. L’invalidazione di una delle View
figlie provoca l’invalidazione a
catena del Visual Tree fino a Grid
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Text="Hello Codemotion!"/>
<Label Grid.Row="1"
Text="Hello Codemotion!"/>
</Grid>
E se l’elemento invalidato è un
nodo foglia e nessun Layout
interrompe il ciclo?!
Grid organizza il layout dei suoi figli in celle individuate da Righe e Colonne
43. Poiché lo spazio messo a
disposizione degli elementi figlio è
proporzionale alla superview ma
indipendente dalle subview, Grid
ignora eventuali notifiche di
invalidazione dai suoi figli
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Text="Hello Codemotion!"/>
<Label Grid.Row="1"
Text="Hello Codemotion!"/>
</Grid>
Grid organizza il layout dei suoi figli in celle individuate da Righe e Colonne
44. Poiché lo spazio messo a
disposizione degli elementi figlio è
fissato staticamente, Grid ignora
eventuali notifiche di invalidazione
dai suoi figli
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Label Text="Hello Codemotion!"/>
<Label Grid.Row="1"
Text="Hello Codemotion!"/>
</Grid>
Grid organizza il layout dei suoi figli in celle individuate da Righe e Colonne
45. Utilizzare le Bindable Property RowSpacing e ColumnSpacing per controllare la
distanza tra Righe e Colonne
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="10"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Label Text="Hello Codemotion!"/>
<Label Grid.Row="1"
Text="Hello Codemotion!"/>
</Grid>
<Grid RowSpacing="10">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Label Text="Hello Codemotion!"/>
<Label Grid.Row="1"
Text="Hello Codemotion!"/>
</Grid>
46. StackLayout organizza il layout dei suoi figli su di un’unica riga o colonna
Ideale per creare Layout semplici impilando
sequenzialmente controlli
Può portare ad un eccessivo nesting del VT
47. L’invalidazione di una delle View figlie
provoca l’invalidazione a catena del
Visual Tree fino a StackLayout
E se l’elemento invalidato è un
nodo foglia e nessun Layout
interrompe il ciclo?!
<StackLayout>
<Label Text="Hello Codemotion!"/>
<Label Text="Hello Codemotion!"/>
</StackLayout>
StackLayout organizza il layout dei suoi figli su di un’unica riga o colonna
Grid - Auto Sizing
48. Golden Rule
“ Don’t use a StackLayout to host a single child
Don’t use a Grid when a StackLayout would do
Don’t use multiple StackLayout when a Grid would do ”
Jason Smith at Evolve 2016
49. AbsoluteLayout permette di posizionare e dimensionare controlli figlio in
maniera assoluta utilizzando valori statici o proporzionali
Ideale se il Layout è facilmente descrivibile e
indipendente dalla posizione di altre view
Massimo delle Performance
Poco Leggibile
50. L’invalidazione di una delle View figlie provoca l’invalidazione a catena del
Visual Tree fino ad AbsoluteLayout
AbsoluteLayout permette di posizionare e dimensionare controlli figlio in
maniera assoluta utilizzando valori statici o proporzionali
<AbsoluteLayout>
<Label Text="Hello Codemotion!"
AbsoluteLayout.LayoutBounds=".02,.01"
AbsoluteLayout.LayoutFlags="PositionProportional"/>
<Label Text="Hello Codemotion!"
AbsoluteLayout.LayoutBounds=".02,.05"
AbsoluteLayout.LayoutFlags="PositionProportional"/>
</AbsoluteLayout>
51. Poiché lo spazio messo a disposizione degli elementi figlio è fissato
staticamente, AbsoluteLayout ignora notifiche di invalidazione dai suoi figli
AbsoluteLayout permette di posizionare e dimensionare controlli figlio in
maniera assoluta utilizzando valori statici o proporzionali
<AbsoluteLayout>
<Label Text="Hello Codemotion!"
AbsoluteLayout.LayoutBounds="10,10,200,100" />
<Label Text="Hello Codemotion!"
AbsoluteLayout.LayoutBounds="10,30,200,100" />
</AbsoluteLayout>
52. Ideale se la dimensione o la posizione dei controlli
del Layout è strettamente correlata
Peggiori Performance
RelativeLayout permette di posizionare e dimensionare controlli figlio
relativamente alla View contenitore o ad altre view del layout
53. L’invalidazione di una delle View figlie provoca l’invalidazione del Visual
Tree fino a RelativeLayout
<RelativeLayout>
<Label x:Name="Label1" Text="Hello Codemotion!" />
<Label Text="Hello Codemotion!"
RelativeLayout.YConstraint=
"{ConstraintExpression Type=RelativeToView,
Property=Y,
ElementName=Label1,
Constant=20}" />
</RelativeLayout>
RelativeLayout permette di posizionare e dimensionare controlli figlio
relativamente alla View contenitore o ad altre view del layout
54. ScrollView aggiunge la funzionalità di scrolling alla sua subview
Non innestare più ScrollView Comportamenti
poco intuitivi
Non innestare ListView Rompe la virtualizzazione
55. Demo
GitHub Repo: bit.ly/2nVm2Ei
N.B. Repo strutturata in submodule
1. Clonare la repo principale (fork di Xamarin.Forms):
2. Checkout sul branch layout:
3. Clonare la subrepo:
4. Avviare il progetto AppDemo4 dalla repo principale
bit.ly/2nzxf1B
bit.ly/2ndfZhE
bit.ly/2nzypdt
56.
57. Il Binding è una funzionalità integrata nel framework Xamarin.Forms
Consente di creare associazioni loosely-coupled tra una proprietà
Sorgente e una proprietà Target
Utilizzato assieme al pattern MVVM, permette di slegare Modello e View
frapponendo uno strato di ViewModel
Source
Qualsiasi Object
Target
BindableObject
BindablePropertyProprietà Pubblica Binding
TwoWay
OneWayToSource
OneWay
58. Binding
1 Scatenata notifica PropertyChange
2 Il Binding legge il valore
della nuova proprietà
3 Il Binding aggiorna la proprietà Target
p.Name = "Jerry";
public abstract class BindableObject : INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
//...
}
59. Golden Rule
“Don’t bind things that can be set statically” Jason Smith at Evolve 2016
public abstract class BindableObject : INotifyPropertyChanged {
//...
void SetValueActual(BindableProperty property, BindablePropertyContext context, object
value, bool currentlyApplying, SetValueFlags attributes, bool silent);
void SetValueCore(BindableProperty property, object value, SetValueFlags attributes,
SetValuePrivateFlags privateAttributes);
}
60.
61. Rendere la UI responsive:
Non interrompere la catena async/await
bloccando il Thread principale su un operazione
I/O Bound
Non eseguire Task altamente computazionali sullo
UI Thread
Obiettivo: 60 fps ad ogni animazione e transizione!
62. Rendere la UI responsive:
Utilizzare il pattern asincrono per restituire subito
il controllo alla Message Pump (UI Thread) -
eventualmente ConfigureAwait(false)
Schedulare CPU-Bound Task su Thread secondari
(Background Thread)
Obiettivo: 60 fps ad ogni animazione e transizione!
Task.Run() Task.Factory.StartNew()
UI
Thread
DownloadAsync
ReadingfromURL
GetString
LoadData
I/O
63. È possibile trarre vantaggio dalla separazione tra Inflating e Rendering
delegando l’esecuzione della prima fase ad un Thread secondario
Task<StackLayout> InflateOnBackgroundThread()
{
return Task.Factory.StartNew(() =>
{
var stackLayout = new StackLayout();
stackLayout.Children.Add(new Label
{
Text = "Hello Codemotion"
});
return stackLayout;
});
}
public MainPage()
{
InflateOnBackgroundThread()
//...
}
64. Nel caso l’Inflating venga eseguito in un Thread secondario:
Non è possibile da BT modificare il Visual Tree
Per farlo, occorre restituire il controllo al Thread chiamante, in questo
caso lo UI Thread
InvalidOperationException
public MainPage()
{
var uiTaskScheduler =
TaskScheduler.FromCurrentSynchronizationContext();
InflateOnBackgroundThread()
.ContinueWith(
task => AddToVisualTree(task.Result),
uiTaskScheduler);
}
Catturare il contesto di
sincronizzazione
corrente
Eseguire l’unmarshalling e
l’aggiunta al VT nello
UI Thread
67. Un punto debole di un’applicazione Xamarin.Forms è rappresentato dai
suoi tempi di avvio
Il principale responsabile è l’avvio del sistema di Rendering ~ 1s
74. Per risolvere questo problema si può pensare di trarre vantaggio dei tempi
di caricamento minori di Xamarin.Native
1. Si avvia l’app seguendo le modalità native e non si inizializza il sistema
di rendering di Forms
2. Si utilizza una View nativa come prima Pagina
3. Si avvia l’engine di Xamarin.Forms in un secondo momento (e.g.
tramite callback, timer, metodi asincroni…)
4. Si utilizzano da qui in poi le API di Forms - eventualmente solo quando
servono (e.g. View semplici come Settings, Login, ecc.)
75. Tutto molto bello ma ancora non supportato da Xamarin.Native
Xamarin.Forms Feature Roadmap
Ma…
76. public class FormsActivity : FormsAppCompatActivity {
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
var pageName = Intent.Extras.GetString("PageType");
var fullName = typeof(FormsApp).Namespace + ".Pages." + pageName;
var pageType = typeof(FormsApp).Assembly.GetType(fullName);
if (!IsFormsInitialized) {
global::Xamarin.Forms.Forms.Init(this, bundle);
IsFormsInitialized = true;
}
LoadApplication(new FormsApp(pageType));
}
}
Possiamo utilizzare le API attuali per caricare pagine Xamarin.Forms in
progetti Xamarin.Native – per View e Layout bisogna però aspettare…
var intent = new Intent(this,
typeof(FormsActivity));
intent.PutExtra("PageType", "SettingsPage");
StartActivity(intent); public FormsApp(Type pageType) {
MainPage =
(Page)Activator.
CreateInstance(pageType);
}
Dopodiché, si avvia normalmente l’Activity con le API di Xamarin.Android
passando l’indicazione della pagina Forms nel Bundle Extra
77. public class FormsWrapperPage : WindowsPage
{
private readonly FormsApp _formsApp;
public FormsWrapperPage()
{
this.InitializeComponent();
LoadApplication(_formsApp = new FormsApp());
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
_formsApp.SetMainPage(e.Parameter as Type);
}
}
Possiamo utilizzare le API attuali per caricare pagine Xamarin.Forms in
progetti Xamarin.Native – per View e Layout bisogna però aspettare…
Dopodiché, si utilizzano normalmente le API di Navigazione di UWP
passando come parametro di navigazione il tipo della Pagina Forms di
destinazione
public SetMainPage(Type pageType) {
MainPage =
(Page)Activator.
CreateInstance(pageType);
}
this.Frame.Navigate(
typeof(FormsWrapperPage),
typeof(SettingsPage));
78. Possiamo utilizzare le API attuali per caricare pagine Xamarin.Forms in
progetti Xamarin.Native – per View e Layout bisogna però aspettare…
Nel caso di iOS la classe Xamarin.Forms.PageExtensions espone il metodo di
estensione CreateViewController Dopodichè, si può presentare il
ViewController utilizzando le API di Xamarin.iOS
public static Page GetPage<T>() where T : Page
{
return Activator.CreateInstance<T>();
}
var settingsViewControler = FormsApp.GetPage<SettingsPage>().CreateViewController();
await this.PresentViewControllerAsync(settingsViewControler, true);