SlideShare une entreprise Scribd logo
1  sur  56
Corso WebApp iOS
             “Optimize iOS WebApps”
                                Lezione 08/10

”Perfection is Achieved not when there is nothing more
to add, but when there is nothing more to take away ”
  Antoine de Saint-Exupéry
   French Writer and Aviator.
Chapter 10
Optimize iOS WebApps




  http://www.apress.com/9781430232469
Diario Lezioni
        LEZIONE 08

   iOS WebApp Anatomy
  Performance Optimization
    Usability Optimization
       Offline WebApp
         Mobile SEO
Performance Opt.
Code Optimization
                 Regola 01

 usare codice complain allo standard W3C

         es: stylsheet nel <head>
      es: Javascript* prima </body>




     * altrimenti può bloccare HTTP request
Code Optimization
                Regola 02

          scrivere codice snello

 es: no espressioni CSS se non necessarie
   es: commenti significativi ma concisi
          es: usare GZip o Minify
Code Optimization
         Regola 03

    ridurre richieste HTTP
Code Optimization
Code Optimization
             Regola 04

   combinare file CSS e Javascript
Code Optimization
Code Optimization
               Regola 05

           minimizzare DOM

      es: numero di accessi al DOM
  es: numero di oggetti DOM da gestire
Image Optimization
               Regola 06

        ottimizzare il color depth

         es: png8, png16, png32
  es: rimuovere metadata dall’immagine
Image Optimization
         Regola 07

      usare CSS Sprite
Image Optimization
Image Optimization
   Sprite Technique (from iWebKit)

    input[type="checkbox"] {
    width: 94px;
    height: 27px;
    background: url('../images/checkbox.png');
    -webkit-appearance: none;
    border: 0;
    float: right;
    margin: 8px 4px 0 0;
    }

    input[type="checkbox"]:checked {
    background-position: 0 27px;
    }
Image Optimization
               Regola 08

     usare CSS al posto di immagini

   es: gradienti o generici background
           es: rounded corners
Image Optimization
                  Regola 09

         mai usare immagini scalate

 es: eccezione portrait-landscape relationship
Diario Lezioni
        LEZIONE 08

   iOS WebApp Anatomy
  Performance Optimization
    Usability Optimization
       Offline WebApp
         Mobile SEO
Usability Optimization
Usability Optimization
   Esempio di Test basato su Paper Prototype

           1.   Scegliere il Contesto
           2.   Creare un Caso d’Uso
           3.   Preparare gli Assets
           4.   Scegliere gli Utenti
           5.   Eseguire il Test
           6.   Esaminare il Test
           7.   Valutare il Test
           8.   Creare Linee Guida
Diario Lezioni
        LEZIONE 08

   iOS WebApp Anatomy
  Performance Optimization
    Usability Optimization
       Offline WebApp
         Mobile SEO
Offline WebApp
          Cache Manifest

          HTML5 feature

  semplice file di testo .manifest
Offline WebApp
          Cache Manifest

 1. Definire il File Cache Manifest
 2. Linkare il file Cache Manifest
 3. Cofigurare il Server
Offline WebApp
          Cache Manifest

         CHACHE MANIFEST
       cache manifest header

                CACHE
 risorse caricate sempre dalla cache
Offline WebApp
           Cache Manifest

               NETWORK
  risorse caricate sempre dal server

                FALLBACK
     risorse usate come rimpiazzo
per risorse che non sono state caricate
      (es: errore dovuto al server)
Offline WebApp
       Cache Manifest

     CHACHE MANIFEST
   cache manifest header

   unica parte obbligatoria
Offline WebApp
  Cache Manifest (Definire il File)

        CACHE MANIFEST
        CACHE
        # Comment on Cache Rule Files
        file01
        file02
        fileN
        NETORK
        # Comment on Network Rule Files
        file01
        file02
        fileN
        FALLBACK
        # Comment on Cache Rule Files
        file01
        file02
        fileN
Offline WebApp
                   Cache Manifest

  commenti usati per marcare la versione della cache
perché il file viene aggiornato quando viene modificato

    possibile aggiornamento forzato via Javascript
Offline WebApp
  Cache Manifest (Definire il File)

        CACHE MANIFEST

        # WebApp Images inside the pic folder
        http://www.thestore.com/images

        # WebApp Images inside the images folder
        http://www.thestore.com/images
Offline WebApp
      Cache Manifest (Linkare il File)

<html manifest="cache-iphone.manifest">

   in tutte le pagine da mandare offline
Offline WebApp
  Cache Manifest (Configurare il Server)

 AddType text/cache-manifest .manifest

nel file .htaccess nella root del web server
Offline WebApp
                       Cache Manifest

se fallisce il download del file manifest (o di una sua risorsa)
         tutto il download/upload della cache fallisce
Offline WebApp
           Cache Manifest (via Javascript)

la gestione via Javascript é più affidabile ed accurata

         si usa i metodi esposti dall’oggetto
              window.applicationCache
Offline WebApp
   Cache Manifest (via Javascript)

 1. Test: Old Cache pronta
 2. Update: Nuova Cache
 3. Swap: Old Cache con New Cache
Offline WebApp
                   Cache Manifest (via Javascript)

  window.applicationCache.UNCACHED     0        Cache is Not Available

     window.applicationCache.IDLE      1         Cache is Up to Date

  window.applicationCache.CHECKING     2   Manifest File Checked for Update

window.applicationCache.DOWNLOADING    3    Downloading the New Cache

 window.applicationCache.UPDATEREADY   4   New Cache Ready to be Updated

  window.applicationCache.OBSOLETE     5   Cache Deleted because Obsolete
Offline WebApp
   Cache Manifest (via Javascript)

     durante l’update della cache
alcuni eventi sono inviati alla WebApp
 per monitorare lo stato del processo
       e reagire di conseguenza
Offline WebApp
                Cache Manifest (via Javascript)
                                    The browser is attempting to download the manifest for the first time
 checking
                                               or is checking whether an update is available

 noupdate                                             The manifest hasn’t been changed

                 The download of resources listed in the manifest has begun, either to gather the resources for the first time
downloading
                                                          or to update the cache

 progress                              The browser is downloading the resources listed in the manifest

                The resources listed in the manifest have all been downloaded, and the application is now available from cache.
  cached
                                                      This is sent only on first download

updateready                            The resources form the cache have all been downloaded anew

                               The manifest is no longer available, and the server has sent a 404 or 410 status.
 obsolete
                                    The cache will be deleted the next time the pplication is launched

   error                                     The manifest has not been found or contains errors
Offline WebApp
            Cache Manifest (via Javascript)

window.applicationCache.onupdateready = doSomethingHandler;
Offline WebApp
               Cache Manifest (via Javascript)

gli eventi possono essere registrati usando i metodi del DOM
       o usando i metodi dell’oggetto ApplicationCache
Offline WebApp
                     Cache Manifest (via Javascript)

if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
    do something here
}
Offline WebApp
           Cache Manifest (via Javascript)

la gestione via Javascript é più affidabile ed accurata

         si usa i metodi esposti dall’oggetto
              window.applicationCache
Offline WebApp
      Cache Manifest (via Javascript)

quando testiamo lo stato col metodo .status

    si usa i metodi esposti dall’oggetto
         window.applicationCache
Diario Lezioni
        LEZIONE 08

   iOS WebApp Anatomy
  Performance Optimization
    Usability Optimization
       Offline WebApp
         Mobile SEO
Mobile SEO
Mobile SEO
                       Domain Name

http://iphone.thestore.com   /* Third Level Domain Name */
http://ipad.thestore.com     /* Third Level Domain Name */
Mobile SEO
                                Page Title

<title>The Store</title>                       /* Store Index Page Title */
<title>The Store (U.S.)</title>                /* US Home Page Title */
<title>The Store (U.S.) | Contact Us</title>   /* US Contacts Page Title */
Mobile SEO
                            Meta Tags

<meta name="Keywords" content="Apple" /> /* Page Keywords Metatag */
Mobile SEO
                         Content

            The Page Header (Primary Keyword)
          The Page Tagline (Secondary Keyword)
    The Page Content (Primary and Secondary Keyword)
The Page Links (Primary Keyword, only wherever is possible)
Mobile SEO
             Content

         approccio facilitato
dalla prioritizzazione dei contenuti
    effettuati nelle versioni iOS
Mobile SEO
Mobile SEO
                           Links

           inbound link: ha un peso per il SE
          outbound link: ha un peso per il SE

internal link: facilita “solamente” il lavoro dei crawler*




          * Google é un crawler-baser search engine
Mobile SEO
                     Images

<a href="#"><img src="pics/hero_iphone4.png"
alt="The New iPhone4"/></a>

   informazioni extra tramite attributo “title”
Mobile SEO
                         Javascript

<script src="javascript/functions.js" type="text/javascript">
</script>

             codice Javascript non é SE friendly
Mobile SEO
              SEO Tools

          Google Analitics

     gratuito ma non in real-time
dati disponibili ogni giorni alle 00:00
Esercitazione
 Utilizzare Guida* di Riferimento
   del Framework e Javascript

1. Implementare le Funzioni Specifiche
2. Implementare la Logica della Dinamica




* versione online e/o formato elettronico
PROSSIMA LEZIONE
         LEGGERE

   Mobile User eXperience
     Test di Usabilità

Contenu connexe

Similaire à Corso WebApp iOS - Lezione 08: Optimize iOS WebApp

What's new in ASP.NET 4.0
What's new in ASP.NET 4.0What's new in ASP.NET 4.0
What's new in ASP.NET 4.0XeDotNet
 
ASP.NET performance optimization
ASP.NET performance optimizationASP.NET performance optimization
ASP.NET performance optimizationAndrea Dottor
 
Installazione del cms alfresco
Installazione del cms alfrescoInstallazione del cms alfresco
Installazione del cms alfrescoMirco Leo
 
Asp.net web form 4.5 - what's new!!
Asp.net web form 4.5 - what's new!!Asp.net web form 4.5 - what's new!!
Asp.net web form 4.5 - what's new!!Massimo Bonanni
 
Le novita di visual studio 2012
Le novita di visual studio 2012Le novita di visual studio 2012
Le novita di visual studio 2012Crismer La Pignola
 
Adobe TechConnection: Flex Best Practices
Adobe TechConnection: Flex Best PracticesAdobe TechConnection: Flex Best Practices
Adobe TechConnection: Flex Best Practicesmarcocasario
 
Presentazione Corso - Parte 3
Presentazione Corso - Parte 3Presentazione Corso - Parte 3
Presentazione Corso - Parte 3Giorgio Carpoca
 
Il PaaS di Google
Il PaaS di GoogleIl PaaS di Google
Il PaaS di GoogleMssiStf
 
Corso WebApp iOS - Lezione 06: Web Development for iOS Devices
Corso WebApp iOS - Lezione 06:   Web Development for iOS DevicesCorso WebApp iOS - Lezione 06:   Web Development for iOS Devices
Corso WebApp iOS - Lezione 06: Web Development for iOS DevicesAndrea Picchi
 
Sviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRailSviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRailStefano Ottaviani
 
Manuale EasyPHP e Wordpress
Manuale EasyPHP e WordpressManuale EasyPHP e Wordpress
Manuale EasyPHP e Wordpressalexperoni
 
Laboratorio Di Basi Di Dati 08 Il Web Server Apache
Laboratorio Di  Basi Di  Dati 08  Il  Web Server  ApacheLaboratorio Di  Basi Di  Dati 08  Il  Web Server  Apache
Laboratorio Di Basi Di Dati 08 Il Web Server Apacheguestbe916c
 
Caso di Studio - Porting da ASP.NET 3.5 a 4.0
Caso di Studio - Porting da ASP.NET 3.5 a 4.0Caso di Studio - Porting da ASP.NET 3.5 a 4.0
Caso di Studio - Porting da ASP.NET 3.5 a 4.0Sinergia Totale
 

Similaire à Corso WebApp iOS - Lezione 08: Optimize iOS WebApp (20)

What's new in ASP.NET 4.0
What's new in ASP.NET 4.0What's new in ASP.NET 4.0
What's new in ASP.NET 4.0
 
ASP.NET performance optimization
ASP.NET performance optimizationASP.NET performance optimization
ASP.NET performance optimization
 
Ajaxare WordPress
Ajaxare WordPressAjaxare WordPress
Ajaxare WordPress
 
Installazione del cms alfresco
Installazione del cms alfrescoInstallazione del cms alfresco
Installazione del cms alfresco
 
Asp.net web form 4.5 - what's new!!
Asp.net web form 4.5 - what's new!!Asp.net web form 4.5 - what's new!!
Asp.net web form 4.5 - what's new!!
 
Le novita di visual studio 2012
Le novita di visual studio 2012Le novita di visual studio 2012
Le novita di visual studio 2012
 
Wpo extended
Wpo extendedWpo extended
Wpo extended
 
Adobe TechConnection: Flex Best Practices
Adobe TechConnection: Flex Best PracticesAdobe TechConnection: Flex Best Practices
Adobe TechConnection: Flex Best Practices
 
Presentazione Corso - Parte 3
Presentazione Corso - Parte 3Presentazione Corso - Parte 3
Presentazione Corso - Parte 3
 
Il PaaS di Google
Il PaaS di GoogleIl PaaS di Google
Il PaaS di Google
 
#dd12 grillo daniele_xpages_tips_tricks_rev2
#dd12 grillo daniele_xpages_tips_tricks_rev2#dd12 grillo daniele_xpages_tips_tricks_rev2
#dd12 grillo daniele_xpages_tips_tricks_rev2
 
Silex, iniziamo
Silex, iniziamoSilex, iniziamo
Silex, iniziamo
 
Corso WebApp iOS - Lezione 06: Web Development for iOS Devices
Corso WebApp iOS - Lezione 06:   Web Development for iOS DevicesCorso WebApp iOS - Lezione 06:   Web Development for iOS Devices
Corso WebApp iOS - Lezione 06: Web Development for iOS Devices
 
Laravel Framework PHP
Laravel Framework PHPLaravel Framework PHP
Laravel Framework PHP
 
Sviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRailSviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRail
 
Manuale EasyPHP e Wordpress
Manuale EasyPHP e WordpressManuale EasyPHP e Wordpress
Manuale EasyPHP e Wordpress
 
Html5 e PHP
Html5 e PHPHtml5 e PHP
Html5 e PHP
 
Laboratorio Di Basi Di Dati 08 Il Web Server Apache
Laboratorio Di  Basi Di  Dati 08  Il  Web Server  ApacheLaboratorio Di  Basi Di  Dati 08  Il  Web Server  Apache
Laboratorio Di Basi Di Dati 08 Il Web Server Apache
 
Caso di Studio - Porting da ASP.NET 3.5 a 4.0
Caso di Studio - Porting da ASP.NET 3.5 a 4.0Caso di Studio - Porting da ASP.NET 3.5 a 4.0
Caso di Studio - Porting da ASP.NET 3.5 a 4.0
 
Java lezione 17
Java lezione 17Java lezione 17
Java lezione 17
 

Plus de Andrea Picchi

The New Retail Paradigm: How the Psychological Foundation of Consumer Behavio...
The New Retail Paradigm: How the Psychological Foundation of Consumer Behavio...The New Retail Paradigm: How the Psychological Foundation of Consumer Behavio...
The New Retail Paradigm: How the Psychological Foundation of Consumer Behavio...Andrea Picchi
 
The 3 Dimensions of Design: A Model to scale the Human-Centered Problem-Solvi...
The 3 Dimensions of Design: A Model to scale the Human-Centered Problem-Solvi...The 3 Dimensions of Design: A Model to scale the Human-Centered Problem-Solvi...
The 3 Dimensions of Design: A Model to scale the Human-Centered Problem-Solvi...Andrea Picchi
 
The Evolution of Design Thinking: Shifting from a Product and Service to a Re...
The Evolution of Design Thinking: Shifting from a Product and Service to a Re...The Evolution of Design Thinking: Shifting from a Product and Service to a Re...
The Evolution of Design Thinking: Shifting from a Product and Service to a Re...Andrea Picchi
 
Continuous Innovation: Going beyond Agile, Lean, and Design Thinking toward a...
Continuous Innovation: Going beyond Agile, Lean, and Design Thinking toward a...Continuous Innovation: Going beyond Agile, Lean, and Design Thinking toward a...
Continuous Innovation: Going beyond Agile, Lean, and Design Thinking toward a...Andrea Picchi
 
The 3 Dimensions of Design: Scaling a Human-Centered Practice across the Orga...
The 3 Dimensions of Design: Scaling a Human-Centered Practice across the Orga...The 3 Dimensions of Design: Scaling a Human-Centered Practice across the Orga...
The 3 Dimensions of Design: Scaling a Human-Centered Practice across the Orga...Andrea Picchi
 
Beyond Design Thinking the 3 Dimension of a Design-Driven Company.
Beyond Design Thinking the 3 Dimension of a Design-Driven Company.Beyond Design Thinking the 3 Dimension of a Design-Driven Company.
Beyond Design Thinking the 3 Dimension of a Design-Driven Company.Andrea Picchi
 
Embedding Design Thinking at Sony to accomplish Business Strategy
Embedding Design Thinking at Sony to accomplish Business StrategyEmbedding Design Thinking at Sony to accomplish Business Strategy
Embedding Design Thinking at Sony to accomplish Business StrategyAndrea Picchi
 
How a Design-Driven Company can Multiply its Business Value
How a Design-Driven Company can Multiply its Business ValueHow a Design-Driven Company can Multiply its Business Value
How a Design-Driven Company can Multiply its Business ValueAndrea Picchi
 
The Evolution of Business Strategy: How to use Design Thinking to uncover hid...
The Evolution of Business Strategy: How to use Design Thinking to uncover hid...The Evolution of Business Strategy: How to use Design Thinking to uncover hid...
The Evolution of Business Strategy: How to use Design Thinking to uncover hid...Andrea Picchi
 
Mobile and Wearable Technologies in the Travel Industry
Mobile and Wearable Technologies in the Travel IndustryMobile and Wearable Technologies in the Travel Industry
Mobile and Wearable Technologies in the Travel IndustryAndrea Picchi
 
A Cognitive Approach to Ecosystem Design
A Cognitive Approach to Ecosystem DesignA Cognitive Approach to Ecosystem Design
A Cognitive Approach to Ecosystem DesignAndrea Picchi
 
Introduction to Agile Scrum
Introduction to Agile ScrumIntroduction to Agile Scrum
Introduction to Agile ScrumAndrea Picchi
 
Designing the User Experience
Designing the User ExperienceDesigning the User Experience
Designing the User ExperienceAndrea Picchi
 
Variabili Cognitive dell'Esperienza Utente
Variabili Cognitive dell'Esperienza UtenteVariabili Cognitive dell'Esperienza Utente
Variabili Cognitive dell'Esperienza UtenteAndrea Picchi
 
Ottimizzazione Cognitiva di Contesti Mobile Touch
Ottimizzazione Cognitiva di Contesti Mobile TouchOttimizzazione Cognitiva di Contesti Mobile Touch
Ottimizzazione Cognitiva di Contesti Mobile TouchAndrea Picchi
 
Analisi e Tecniche di Design Cognitivo per Contesti Mobile Touch
Analisi e Tecniche di Design Cognitivo per Contesti Mobile TouchAnalisi e Tecniche di Design Cognitivo per Contesti Mobile Touch
Analisi e Tecniche di Design Cognitivo per Contesti Mobile TouchAndrea Picchi
 
Ottimizzazione e Analisi Cognitiva di Contesti Mobile Touch
Ottimizzazione e Analisi Cognitiva di Contesti Mobile TouchOttimizzazione e Analisi Cognitiva di Contesti Mobile Touch
Ottimizzazione e Analisi Cognitiva di Contesti Mobile TouchAndrea Picchi
 
Corso WebApp iOS - Lezione 09: Testing iOS WebApp
Corso WebApp iOS - Lezione 09: Testing iOS WebAppCorso WebApp iOS - Lezione 09: Testing iOS WebApp
Corso WebApp iOS - Lezione 09: Testing iOS WebAppAndrea Picchi
 
Corso WebApp iOS - Lezione 07: iOS WebApp Anatomy
Corso WebApp iOS - Lezione 07: iOS WebApp AnatomyCorso WebApp iOS - Lezione 07: iOS WebApp Anatomy
Corso WebApp iOS - Lezione 07: iOS WebApp AnatomyAndrea Picchi
 
Corso WebApp iOS - Lezione 05: Mobile Touch Development
Corso WebApp iOS - Lezione 05: Mobile Touch DevelopmentCorso WebApp iOS - Lezione 05: Mobile Touch Development
Corso WebApp iOS - Lezione 05: Mobile Touch DevelopmentAndrea Picchi
 

Plus de Andrea Picchi (20)

The New Retail Paradigm: How the Psychological Foundation of Consumer Behavio...
The New Retail Paradigm: How the Psychological Foundation of Consumer Behavio...The New Retail Paradigm: How the Psychological Foundation of Consumer Behavio...
The New Retail Paradigm: How the Psychological Foundation of Consumer Behavio...
 
The 3 Dimensions of Design: A Model to scale the Human-Centered Problem-Solvi...
The 3 Dimensions of Design: A Model to scale the Human-Centered Problem-Solvi...The 3 Dimensions of Design: A Model to scale the Human-Centered Problem-Solvi...
The 3 Dimensions of Design: A Model to scale the Human-Centered Problem-Solvi...
 
The Evolution of Design Thinking: Shifting from a Product and Service to a Re...
The Evolution of Design Thinking: Shifting from a Product and Service to a Re...The Evolution of Design Thinking: Shifting from a Product and Service to a Re...
The Evolution of Design Thinking: Shifting from a Product and Service to a Re...
 
Continuous Innovation: Going beyond Agile, Lean, and Design Thinking toward a...
Continuous Innovation: Going beyond Agile, Lean, and Design Thinking toward a...Continuous Innovation: Going beyond Agile, Lean, and Design Thinking toward a...
Continuous Innovation: Going beyond Agile, Lean, and Design Thinking toward a...
 
The 3 Dimensions of Design: Scaling a Human-Centered Practice across the Orga...
The 3 Dimensions of Design: Scaling a Human-Centered Practice across the Orga...The 3 Dimensions of Design: Scaling a Human-Centered Practice across the Orga...
The 3 Dimensions of Design: Scaling a Human-Centered Practice across the Orga...
 
Beyond Design Thinking the 3 Dimension of a Design-Driven Company.
Beyond Design Thinking the 3 Dimension of a Design-Driven Company.Beyond Design Thinking the 3 Dimension of a Design-Driven Company.
Beyond Design Thinking the 3 Dimension of a Design-Driven Company.
 
Embedding Design Thinking at Sony to accomplish Business Strategy
Embedding Design Thinking at Sony to accomplish Business StrategyEmbedding Design Thinking at Sony to accomplish Business Strategy
Embedding Design Thinking at Sony to accomplish Business Strategy
 
How a Design-Driven Company can Multiply its Business Value
How a Design-Driven Company can Multiply its Business ValueHow a Design-Driven Company can Multiply its Business Value
How a Design-Driven Company can Multiply its Business Value
 
The Evolution of Business Strategy: How to use Design Thinking to uncover hid...
The Evolution of Business Strategy: How to use Design Thinking to uncover hid...The Evolution of Business Strategy: How to use Design Thinking to uncover hid...
The Evolution of Business Strategy: How to use Design Thinking to uncover hid...
 
Mobile and Wearable Technologies in the Travel Industry
Mobile and Wearable Technologies in the Travel IndustryMobile and Wearable Technologies in the Travel Industry
Mobile and Wearable Technologies in the Travel Industry
 
A Cognitive Approach to Ecosystem Design
A Cognitive Approach to Ecosystem DesignA Cognitive Approach to Ecosystem Design
A Cognitive Approach to Ecosystem Design
 
Introduction to Agile Scrum
Introduction to Agile ScrumIntroduction to Agile Scrum
Introduction to Agile Scrum
 
Designing the User Experience
Designing the User ExperienceDesigning the User Experience
Designing the User Experience
 
Variabili Cognitive dell'Esperienza Utente
Variabili Cognitive dell'Esperienza UtenteVariabili Cognitive dell'Esperienza Utente
Variabili Cognitive dell'Esperienza Utente
 
Ottimizzazione Cognitiva di Contesti Mobile Touch
Ottimizzazione Cognitiva di Contesti Mobile TouchOttimizzazione Cognitiva di Contesti Mobile Touch
Ottimizzazione Cognitiva di Contesti Mobile Touch
 
Analisi e Tecniche di Design Cognitivo per Contesti Mobile Touch
Analisi e Tecniche di Design Cognitivo per Contesti Mobile TouchAnalisi e Tecniche di Design Cognitivo per Contesti Mobile Touch
Analisi e Tecniche di Design Cognitivo per Contesti Mobile Touch
 
Ottimizzazione e Analisi Cognitiva di Contesti Mobile Touch
Ottimizzazione e Analisi Cognitiva di Contesti Mobile TouchOttimizzazione e Analisi Cognitiva di Contesti Mobile Touch
Ottimizzazione e Analisi Cognitiva di Contesti Mobile Touch
 
Corso WebApp iOS - Lezione 09: Testing iOS WebApp
Corso WebApp iOS - Lezione 09: Testing iOS WebAppCorso WebApp iOS - Lezione 09: Testing iOS WebApp
Corso WebApp iOS - Lezione 09: Testing iOS WebApp
 
Corso WebApp iOS - Lezione 07: iOS WebApp Anatomy
Corso WebApp iOS - Lezione 07: iOS WebApp AnatomyCorso WebApp iOS - Lezione 07: iOS WebApp Anatomy
Corso WebApp iOS - Lezione 07: iOS WebApp Anatomy
 
Corso WebApp iOS - Lezione 05: Mobile Touch Development
Corso WebApp iOS - Lezione 05: Mobile Touch DevelopmentCorso WebApp iOS - Lezione 05: Mobile Touch Development
Corso WebApp iOS - Lezione 05: Mobile Touch Development
 

Corso WebApp iOS - Lezione 08: Optimize iOS WebApp

  • 1. Corso WebApp iOS “Optimize iOS WebApps” Lezione 08/10 ”Perfection is Achieved not when there is nothing more to add, but when there is nothing more to take away ” Antoine de Saint-Exupéry French Writer and Aviator.
  • 2. Chapter 10 Optimize iOS WebApps http://www.apress.com/9781430232469
  • 3. Diario Lezioni LEZIONE 08 iOS WebApp Anatomy Performance Optimization Usability Optimization Offline WebApp Mobile SEO
  • 5. Code Optimization Regola 01 usare codice complain allo standard W3C es: stylsheet nel <head> es: Javascript* prima </body> * altrimenti può bloccare HTTP request
  • 6. Code Optimization Regola 02 scrivere codice snello es: no espressioni CSS se non necessarie es: commenti significativi ma concisi es: usare GZip o Minify
  • 7. Code Optimization Regola 03 ridurre richieste HTTP
  • 9. Code Optimization Regola 04 combinare file CSS e Javascript
  • 11. Code Optimization Regola 05 minimizzare DOM es: numero di accessi al DOM es: numero di oggetti DOM da gestire
  • 12. Image Optimization Regola 06 ottimizzare il color depth es: png8, png16, png32 es: rimuovere metadata dall’immagine
  • 13. Image Optimization Regola 07 usare CSS Sprite
  • 15. Image Optimization Sprite Technique (from iWebKit) input[type="checkbox"] { width: 94px; height: 27px; background: url('../images/checkbox.png'); -webkit-appearance: none; border: 0; float: right; margin: 8px 4px 0 0; } input[type="checkbox"]:checked { background-position: 0 27px; }
  • 16. Image Optimization Regola 08 usare CSS al posto di immagini es: gradienti o generici background es: rounded corners
  • 17. Image Optimization Regola 09 mai usare immagini scalate es: eccezione portrait-landscape relationship
  • 18. Diario Lezioni LEZIONE 08 iOS WebApp Anatomy Performance Optimization Usability Optimization Offline WebApp Mobile SEO
  • 20. Usability Optimization Esempio di Test basato su Paper Prototype 1. Scegliere il Contesto 2. Creare un Caso d’Uso 3. Preparare gli Assets 4. Scegliere gli Utenti 5. Eseguire il Test 6. Esaminare il Test 7. Valutare il Test 8. Creare Linee Guida
  • 21. Diario Lezioni LEZIONE 08 iOS WebApp Anatomy Performance Optimization Usability Optimization Offline WebApp Mobile SEO
  • 22. Offline WebApp Cache Manifest HTML5 feature semplice file di testo .manifest
  • 23. Offline WebApp Cache Manifest 1. Definire il File Cache Manifest 2. Linkare il file Cache Manifest 3. Cofigurare il Server
  • 24. Offline WebApp Cache Manifest CHACHE MANIFEST cache manifest header CACHE risorse caricate sempre dalla cache
  • 25. Offline WebApp Cache Manifest NETWORK risorse caricate sempre dal server FALLBACK risorse usate come rimpiazzo per risorse che non sono state caricate (es: errore dovuto al server)
  • 26. Offline WebApp Cache Manifest CHACHE MANIFEST cache manifest header unica parte obbligatoria
  • 27. Offline WebApp Cache Manifest (Definire il File) CACHE MANIFEST CACHE # Comment on Cache Rule Files file01 file02 fileN NETORK # Comment on Network Rule Files file01 file02 fileN FALLBACK # Comment on Cache Rule Files file01 file02 fileN
  • 28. Offline WebApp Cache Manifest commenti usati per marcare la versione della cache perché il file viene aggiornato quando viene modificato possibile aggiornamento forzato via Javascript
  • 29. Offline WebApp Cache Manifest (Definire il File) CACHE MANIFEST # WebApp Images inside the pic folder http://www.thestore.com/images # WebApp Images inside the images folder http://www.thestore.com/images
  • 30. Offline WebApp Cache Manifest (Linkare il File) <html manifest="cache-iphone.manifest"> in tutte le pagine da mandare offline
  • 31. Offline WebApp Cache Manifest (Configurare il Server) AddType text/cache-manifest .manifest nel file .htaccess nella root del web server
  • 32. Offline WebApp Cache Manifest se fallisce il download del file manifest (o di una sua risorsa) tutto il download/upload della cache fallisce
  • 33. Offline WebApp Cache Manifest (via Javascript) la gestione via Javascript é più affidabile ed accurata si usa i metodi esposti dall’oggetto window.applicationCache
  • 34. Offline WebApp Cache Manifest (via Javascript) 1. Test: Old Cache pronta 2. Update: Nuova Cache 3. Swap: Old Cache con New Cache
  • 35. Offline WebApp Cache Manifest (via Javascript) window.applicationCache.UNCACHED 0 Cache is Not Available window.applicationCache.IDLE 1 Cache is Up to Date window.applicationCache.CHECKING 2 Manifest File Checked for Update window.applicationCache.DOWNLOADING 3 Downloading the New Cache window.applicationCache.UPDATEREADY 4 New Cache Ready to be Updated window.applicationCache.OBSOLETE 5 Cache Deleted because Obsolete
  • 36. Offline WebApp Cache Manifest (via Javascript) durante l’update della cache alcuni eventi sono inviati alla WebApp per monitorare lo stato del processo e reagire di conseguenza
  • 37. Offline WebApp Cache Manifest (via Javascript) The browser is attempting to download the manifest for the first time checking or is checking whether an update is available noupdate The manifest hasn’t been changed The download of resources listed in the manifest has begun, either to gather the resources for the first time downloading or to update the cache progress The browser is downloading the resources listed in the manifest The resources listed in the manifest have all been downloaded, and the application is now available from cache. cached This is sent only on first download updateready The resources form the cache have all been downloaded anew The manifest is no longer available, and the server has sent a 404 or 410 status. obsolete The cache will be deleted the next time the pplication is launched error The manifest has not been found or contains errors
  • 38. Offline WebApp Cache Manifest (via Javascript) window.applicationCache.onupdateready = doSomethingHandler;
  • 39. Offline WebApp Cache Manifest (via Javascript) gli eventi possono essere registrati usando i metodi del DOM o usando i metodi dell’oggetto ApplicationCache
  • 40. Offline WebApp Cache Manifest (via Javascript) if (window.applicationCache.status == window.applicationCache.UPDATEREADY) { do something here }
  • 41. Offline WebApp Cache Manifest (via Javascript) la gestione via Javascript é più affidabile ed accurata si usa i metodi esposti dall’oggetto window.applicationCache
  • 42. Offline WebApp Cache Manifest (via Javascript) quando testiamo lo stato col metodo .status si usa i metodi esposti dall’oggetto window.applicationCache
  • 43. Diario Lezioni LEZIONE 08 iOS WebApp Anatomy Performance Optimization Usability Optimization Offline WebApp Mobile SEO
  • 45. Mobile SEO Domain Name http://iphone.thestore.com /* Third Level Domain Name */ http://ipad.thestore.com /* Third Level Domain Name */
  • 46. Mobile SEO Page Title <title>The Store</title> /* Store Index Page Title */ <title>The Store (U.S.)</title> /* US Home Page Title */ <title>The Store (U.S.) | Contact Us</title> /* US Contacts Page Title */
  • 47. Mobile SEO Meta Tags <meta name="Keywords" content="Apple" /> /* Page Keywords Metatag */
  • 48. Mobile SEO Content The Page Header (Primary Keyword) The Page Tagline (Secondary Keyword) The Page Content (Primary and Secondary Keyword) The Page Links (Primary Keyword, only wherever is possible)
  • 49. Mobile SEO Content approccio facilitato dalla prioritizzazione dei contenuti effettuati nelle versioni iOS
  • 51. Mobile SEO Links inbound link: ha un peso per il SE outbound link: ha un peso per il SE internal link: facilita “solamente” il lavoro dei crawler* * Google é un crawler-baser search engine
  • 52. Mobile SEO Images <a href="#"><img src="pics/hero_iphone4.png" alt="The New iPhone4"/></a> informazioni extra tramite attributo “title”
  • 53. Mobile SEO Javascript <script src="javascript/functions.js" type="text/javascript"> </script> codice Javascript non é SE friendly
  • 54. Mobile SEO SEO Tools Google Analitics gratuito ma non in real-time dati disponibili ogni giorni alle 00:00
  • 55. Esercitazione Utilizzare Guida* di Riferimento del Framework e Javascript 1. Implementare le Funzioni Specifiche 2. Implementare la Logica della Dinamica * versione online e/o formato elettronico
  • 56. PROSSIMA LEZIONE LEGGERE Mobile User eXperience Test di Usabilità