SlideShare uma empresa Scribd logo
1 de 62
Baixar para ler offline
Building HTML5 Apps
Ariya Hidayat, Sencha
08/29/11
2
Building HTML5 App



   Ariya Hidayat
Engineering Director


                           08/29/11
                       3
whoami




             08/29/11
         4
1
Pure web apps (run in the browser)


Hybrid solution (delivered as native apps)


                           2

                                  08/29/11
                             5
Pure Web Apps




                    08/29/11
                6
Common Myths

                       Slow          Does not use GPU acceleration

 Only works offline
                       Manual layout of apps
                                               No GUI designer
     Only JavaScript
                               Tedious to code

          Can’t do fluid animation       Not crossplatform




                                                                 08/29/11
                                                        7
“Too many phones will kill you...”




                                         08/29/11
                                     8
Supported Platforms



Desktop



 Mobile




                          08/29/11
                      9
Adoption




                08/29/11
           10
Amazon Kindle Cloud Reader




                                  08/29/11
                             11
Financial Times




                       08/29/11
                  12
JavaScript: Ubiquitous Programming Environment




                                          08/29/11
                                     13
Need for Speed

                               SunSpider 0.9.1


Internet Explorer 8                                    7.43 seconds
 Google Chrome 13     0.44 seconds
          Firefox 6   0.41 seconds




                                                      08/29/11
                                                 14
Libraries and Frameworks




                                08/29/11
                           15
Offline Support

                  Application Cache
                    Local Storage




                            08/29/11
                     16
Application Cache
                                    CACHE MANIFEST
                                    # version 42

                                    CACHE:
                                    style.css
                                    logic.js
                                    images/logo.png
<html manifest=”foobar.appcache”>
...
</html>                             NETWORK:
                                    http://api.example.com
                                    login/

                                    FALLBACK:
                                    *.html offline.html




                                                               08/29/11
                                                          17
Application Cache


                      offline        online


 CACHE              use cache       update

 NETWORK             can’t use     use remote


 FALLBACK           use fallback   use remote




                                                08/29/11
                                        18
Local Storage                          ~ 5 MB


        localStorage.setItem(‘foo’, ‘bar’);

        localStorage.getItem(‘foo’);

        localStorage.removeItem(‘foo’);

        localStorage.clear();




                                                     08/29/11
                                                19
CSS3 Animation




    http://mozillademos.org/demos/planetarium/demo.html


                                                     08/29/11
                                               20
Canvas for Visualization




     JavaScript InfoVis Toolkit   http://thejit.org/



                                                       08/29/11
                                             21
Canvas for Games




       http://ariya.blogspot.com/2010/09/inv
                                             ade-destroy.html




                                                                     08/29/11
                                                                22
Pixel Manipulations




            http://ariya.github.com/canvas/crossfading/



                                                               08/29/11
                                                          23
Vector Graphics




             http://raphaeljs.com/polar-clock.html




                                                          08/29/11
                                                     24
WebGL for 3-D




http://webglsamples.googlecode.com/hg/aquarium/aquarium.html


                                                      08/29/11
                                                25
WebGL for Visualization




          http://senchalabs.github.com/philogl/


                                                       08/29/11
                                                  26
Which is for what?

                               CSS3   Canvas   SVG      WebGL
    Animation of UI elements    ✔
        2-D visualization               ✔      ✔
      Imperative drawing                ✔
       2-D scene-graph                         ✔         ✔
        3-D scene graph                                  ✔
           2-D game                     ✔      ✔         ✔
           3-D game                                      ✔



                                                          08/29/11
                                                   27
Hybrid Native + Web




                       08/29/11
                  28
Going Hybrid?

       Platform Integration
                               Security




      Advanced Technologies   App Store/ Marketplace




                                                       08/29/11
                                                29
Real-world Hybrid Apps




          Ext Designer   Sencha Animator




                                                08/29/11
                                           30
WebKit Everywhere

   Browser



   Devices




   Runtime




                         08/29/11
                    31
~2000 commits/month
    History
            100000


            80000


            60000
Revisions




            40000


            20000


                0
                     0   1   2   3   4     5     6   7   8        9      10
                                         Years

                                                                      08/29/11
                                                             32
Components of WebKit

          DOM               CSS


                WebCore              SVG


   HTML
                      rendering

                                           JavaScriptCore



                    WebKit Library




                                                            08/29/11
                                                  33
Platform Abstraction


       Network          Unicode      Clipboard


       Graphics          Theme        Events


        Thread         Geolocation    Timer




                                                 08/29/11
                                           34
WebCore
Different “Ports”                                     graphics



GraphicsContext         Mac        Chromium       Qt         Gtk


                                     Skia                       Cairo
                    CoreGraphics
                                               QPainter


                                        graphics stack



                                                          08/29/11
                                                 35
QWeb* classes

                QWebView (widget)


                QWebPage (object)

                     QWebFrame (object)


                 At least one, i.e. the main frame of the page




                                                      08/29/11
                                             36
Using QWebView



       QWebView webView;
       webView.show();
       webView.setUrl(QUrl("http://meego.com"));




                                                        08/29/11
                                                   37
Contents via String



        QWebView webView;
        webView.show();
        webView.setContent("<body>Hello, MeeGo!</body>");




                                                             08/29/11
                                                        38
Contents via Resource
                             <RCC>
                                 <qresource prefix="/">
                                     <file>content.html</file>
                                 </qresource>
                             </RCC>


       QWebView webView;
       webView.show();
       webView.setUrl(QUrl("qrc:/content.html"));




                                                                 08/29/11
                                                           39
Capture to Image

       QWebPage page;
       QImage image(size, QImage::Format_ARGB32_Premultiplied);
       image.fill(Qt::transparent);
       QPainter p(&image);
       page.mainFrame()->render(&p);
       p.end();
       image.save(fileName);




     http://labs.qt.nokia.com/2009/01/15/capturing-web-pages/




                                                                       08/29/11
                                                                  40
SVG Rasterizer




   http://labs.qt.nokia.com/2008/08/06/webkit-based-svg-rasterizer/



                                                                08/29/11
                                                         41
Search + Preview




  http://labs.qt.nokia.com/2008/11/04/search-with-thumbnail-preview/



                                                                08/29/11
                                                         42
Exposing to the Web World


    QWebFrame::addToJavaScriptWindowObject(QString, QObject*)



                                Public functions
                                Object properties
                                  Child objects




                                                            08/29/11
                                                     43
Exposing to the Web World

page()->mainFrame()->addToJavaScriptWindowObject("Dialog", new Dialog);



                  class Dialog: public QObject
                  {
                      Q_OBJECT

                  public:
                      Dialog(QObject *parent = 0);

                  public slots:
                      void showMessage(const QString& msg);
                  };




                                                                   08/29/11
                                                              44
Exposing to the Web World

    <input type="button" value="Try this"
    onClick="Dialog.showMessage('You clicked me!')">




        instance of
       Dialog object         public slot




                                                       08/29/11
                                                45
Signal and Slot

                  signal


       foobar.modified.connect(refresh);

        QObject instance       JavaScript function


      foobar.modified.connect(obj, refresh);
                                 any object




                                                          08/29/11
                                                     46
Triggering Action from Native

class Stopwatch: public QObject   Stopwatch::Stopwatch(QObject *parent)
{                                     : QObject(parent)
    Q_OBJECT                          , m_index(0)
                                  {
public:                               QTimer *timer = new QTimer(this);
    Stopwatch(QObject *parent =       timer->setInterval(1000);
0);                                   connect(timer, SIGNAL(timeout()), SLOT(update()));
                                      timer->start();
signals:                          }
    void tick(int t);
                                  void Stopwatch::update()
private slots:                    {
    void update();                    emit tick(m_index++);
                                  }
private:
    int m_index;
};




                                                                          08/29/11
                                                                  47
Triggering Action from Native

       instance of
     Stopwatch object
                              signal



        <script>
        Stopwatch.tick.connect(function(t) {
            document.getElementById('tick').innerText = t;
        });
        </script>




                                                             08/29/11
                                                     48
Coming Back to Native


     QVariant QWebFrame::evaluateJavaScript(QString)


         mostly key-value pair
        (like JavaScript objects)




                                                            08/29/11
                                                       49
Platform Integration

                      Menu and Menu Bar

                                                     Dialogs


                              Application
      System Access




                                      Notifications




                                                               08/29/11
                                                        50
Debugging




settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);




                                                               08/29/11
                                                         51
Consume Web 2.0




   http://labs.qt.nokia.com/2009/03/08/creating-a-google-chat-client-in-15-minutes/




                                                                                 08/29/11
                                                                        52
http://bit.ly/x2-codemirror
Code Editor




                                08/29/11
                       53
http://bit.ly/x2-foldervis
Folder Visualization




                                        08/29/11
                              54
GPU Acceleration




                        08/29/11
                   55
Game vs Web




                   08/29/11
              56
Primitive Drawing




                         08/29/11
                    57
Backing Store




  when you pinch...




                           08/29/11
                      58
Layer Compositing




                         08/29/11
                    59
Logical 3-D   smooth animation FTW!




                                           08/29/11
                                      60
Conclusions


              Web technologies are moving really fast
       Various frameworks and libraries boost the productivity
                Hybrid approach helps the migration
                       Tools need to catch-up




                                                                  08/29/11
                                                             61
THANK YOU!


             ariya.hidayat@gmail.com


             ariya.ofilabs.com


             @ariyahidayat




                                            08/29/11
                                       62

Mais conteúdo relacionado

Mais procurados

Node.js on microsoft azure april 2014
Node.js on microsoft azure april 2014Node.js on microsoft azure april 2014
Node.js on microsoft azure april 2014Brian Benz
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGuillaume Laforge
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsBinary Studio
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....Patrick Lauke
 
A web perf dashboard up & running in 90 minutes presentation
A web perf dashboard up & running in 90 minutes presentationA web perf dashboard up & running in 90 minutes presentation
A web perf dashboard up & running in 90 minutes presentationJustin Dorfman
 
Brave new world of HTML5
Brave new world of HTML5Brave new world of HTML5
Brave new world of HTML5Chris Mills
 
Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022NAVER D2
 
Webpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of usWebpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of usStefan Adolf
 
Asynchronous Module Definition (AMD)
Asynchronous Module Definition (AMD)Asynchronous Module Definition (AMD)
Asynchronous Module Definition (AMD)xMartin12
 
Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009Arun Gupta
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Libraryjeresig
 
Forensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsForensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsNicholas Jansma
 
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformBackend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformAlvaro Viebrantz
 
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스Rhio Kim
 
Hardware Acceleration in WebKit
Hardware Acceleration in WebKitHardware Acceleration in WebKit
Hardware Acceleration in WebKitJoone Hur
 

Mais procurados (20)

Node.js on microsoft azure april 2014
Node.js on microsoft azure april 2014Node.js on microsoft azure april 2014
Node.js on microsoft azure april 2014
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific Languages
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphics
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
 
A web perf dashboard up & running in 90 minutes presentation
A web perf dashboard up & running in 90 minutes presentationA web perf dashboard up & running in 90 minutes presentation
A web perf dashboard up & running in 90 minutes presentation
 
Brave new world of HTML5
Brave new world of HTML5Brave new world of HTML5
Brave new world of HTML5
 
Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022
 
Mlocjs buzdin
Mlocjs buzdinMlocjs buzdin
Mlocjs buzdin
 
Webpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of usWebpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of us
 
Asynchronous Module Definition (AMD)
Asynchronous Module Definition (AMD)Asynchronous Module Definition (AMD)
Asynchronous Module Definition (AMD)
 
Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 
Intro To Grails
Intro To GrailsIntro To Grails
Intro To Grails
 
Forensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsForensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance Investigations
 
GWT Extreme!
GWT Extreme!GWT Extreme!
GWT Extreme!
 
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformBackend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
 
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
 
CRUD with Polymer 2.0
CRUD with Polymer 2.0CRUD with Polymer 2.0
CRUD with Polymer 2.0
 
Hardware Acceleration in WebKit
Hardware Acceleration in WebKitHardware Acceleration in WebKit
Hardware Acceleration in WebKit
 

Semelhante a Build HTML5 App (Intel Elements 2011)

Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Seung Joon Choi
 
Alejandro Villanueva - Google Inc.
Alejandro Villanueva - Google Inc.Alejandro Villanueva - Google Inc.
Alejandro Villanueva - Google Inc.Alejandro Corpeño
 
Google - Charla para CTOs
Google - Charla para CTOsGoogle - Charla para CTOs
Google - Charla para CTOsPalermo Valley
 
WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013Tony Parisi
 
WebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonWebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonTony Parisi
 
Device系APIの全体図
Device系APIの全体図Device系APIの全体図
Device系APIの全体図Kensaku Komatsu
 
App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010Chris Schalk
 
Html5 mobile develop tools
Html5 mobile develop toolsHtml5 mobile develop tools
Html5 mobile develop toolsLey Liu
 
Mozilla In Malaysia
Mozilla In MalaysiaMozilla In Malaysia
Mozilla In MalaysiaGen Kanai
 
Michael(tm) Smith WND09 Presentation
Michael(tm) Smith WND09 PresentationMichael(tm) Smith WND09 Presentation
Michael(tm) Smith WND09 PresentationMichael(tm) Smith
 
App Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures PublishApp Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures PublishChris Schalk
 
Google html5 Tutorial
Google html5 TutorialGoogle html5 Tutorial
Google html5 Tutorialjobfan
 
Widget Workshop Advanced Development
Widget Workshop Advanced DevelopmentWidget Workshop Advanced Development
Widget Workshop Advanced DevelopmentDominik Helleberg
 
HTML5 and the Open Web Platform
HTML5 and the Open Web PlatformHTML5 and the Open Web Platform
HTML5 and the Open Web PlatformBeat Signer
 
Drupalcamp New York 2009
Drupalcamp New York 2009Drupalcamp New York 2009
Drupalcamp New York 2009Tom Deryckere
 
Estado da Arte HTML5
Estado da Arte HTML5Estado da Arte HTML5
Estado da Arte HTML5MCM-IPG
 

Semelhante a Build HTML5 App (Intel Elements 2011) (20)

Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Webgl 기술동향 2011.8
Webgl 기술동향 2011.8
 
Alejandro Villanueva - Google Inc.
Alejandro Villanueva - Google Inc.Alejandro Villanueva - Google Inc.
Alejandro Villanueva - Google Inc.
 
Google - Charla para CTOs
Google - Charla para CTOsGoogle - Charla para CTOs
Google - Charla para CTOs
 
WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013
 
Zembly
ZemblyZembly
Zembly
 
WebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonWebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was Won
 
Device系APIの全体図
Device系APIの全体図Device系APIの全体図
Device系APIの全体図
 
App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010
 
Hybrid mobile apps
Hybrid mobile appsHybrid mobile apps
Hybrid mobile apps
 
Html5 mobile develop tools
Html5 mobile develop toolsHtml5 mobile develop tools
Html5 mobile develop tools
 
Mozilla In Malaysia
Mozilla In MalaysiaMozilla In Malaysia
Mozilla In Malaysia
 
Michael(tm) Smith WND09 Presentation
Michael(tm) Smith WND09 PresentationMichael(tm) Smith WND09 Presentation
Michael(tm) Smith WND09 Presentation
 
App Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures PublishApp Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures Publish
 
Google html5 Tutorial
Google html5 TutorialGoogle html5 Tutorial
Google html5 Tutorial
 
Html5
Html5Html5
Html5
 
Widget Workshop Advanced Development
Widget Workshop Advanced DevelopmentWidget Workshop Advanced Development
Widget Workshop Advanced Development
 
HTML5 and the Open Web Platform
HTML5 and the Open Web PlatformHTML5 and the Open Web Platform
HTML5 and the Open Web Platform
 
Drupalcamp New York 2009
Drupalcamp New York 2009Drupalcamp New York 2009
Drupalcamp New York 2009
 
Estado da Arte HTML5
Estado da Arte HTML5Estado da Arte HTML5
Estado da Arte HTML5
 
JavaME UI - JMDF 2007
JavaME UI - JMDF 2007JavaME UI - JMDF 2007
JavaME UI - JMDF 2007
 

Mais de Ariya Hidayat

Understanding Webkit Rendering
Understanding Webkit RenderingUnderstanding Webkit Rendering
Understanding Webkit RenderingAriya Hidayat
 
JavaScript Parser Infrastructure for Code Quality Analysis
JavaScript Parser Infrastructure for Code Quality AnalysisJavaScript Parser Infrastructure for Code Quality Analysis
JavaScript Parser Infrastructure for Code Quality AnalysisAriya Hidayat
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitAriya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitAriya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitAriya Hidayat
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with QtAriya Hidayat
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKitAriya Hidayat
 

Mais de Ariya Hidayat (7)

Understanding Webkit Rendering
Understanding Webkit RenderingUnderstanding Webkit Rendering
Understanding Webkit Rendering
 
JavaScript Parser Infrastructure for Code Quality Analysis
JavaScript Parser Infrastructure for Code Quality AnalysisJavaScript Parser Infrastructure for Code Quality Analysis
JavaScript Parser Infrastructure for Code Quality Analysis
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with Qt
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKit
 

Último

Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 

Último (20)

Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 

Build HTML5 App (Intel Elements 2011)

  • 1. Building HTML5 Apps Ariya Hidayat, Sencha
  • 3. Building HTML5 App Ariya Hidayat Engineering Director 08/29/11 3
  • 4. whoami 08/29/11 4
  • 5. 1 Pure web apps (run in the browser) Hybrid solution (delivered as native apps) 2 08/29/11 5
  • 6. Pure Web Apps 08/29/11 6
  • 7. Common Myths Slow Does not use GPU acceleration Only works offline Manual layout of apps No GUI designer Only JavaScript Tedious to code Can’t do fluid animation Not crossplatform 08/29/11 7
  • 8. “Too many phones will kill you...” 08/29/11 8
  • 10. Adoption 08/29/11 10
  • 11. Amazon Kindle Cloud Reader 08/29/11 11
  • 12. Financial Times 08/29/11 12
  • 13. JavaScript: Ubiquitous Programming Environment 08/29/11 13
  • 14. Need for Speed SunSpider 0.9.1 Internet Explorer 8 7.43 seconds Google Chrome 13 0.44 seconds Firefox 6 0.41 seconds 08/29/11 14
  • 16. Offline Support Application Cache Local Storage 08/29/11 16
  • 17. Application Cache CACHE MANIFEST # version 42 CACHE: style.css logic.js images/logo.png <html manifest=”foobar.appcache”> ... </html> NETWORK: http://api.example.com login/ FALLBACK: *.html offline.html 08/29/11 17
  • 18. Application Cache offline online CACHE use cache update NETWORK can’t use use remote FALLBACK use fallback use remote 08/29/11 18
  • 19. Local Storage ~ 5 MB localStorage.setItem(‘foo’, ‘bar’); localStorage.getItem(‘foo’); localStorage.removeItem(‘foo’); localStorage.clear(); 08/29/11 19
  • 20. CSS3 Animation http://mozillademos.org/demos/planetarium/demo.html 08/29/11 20
  • 21. Canvas for Visualization JavaScript InfoVis Toolkit http://thejit.org/ 08/29/11 21
  • 22. Canvas for Games http://ariya.blogspot.com/2010/09/inv ade-destroy.html 08/29/11 22
  • 23. Pixel Manipulations http://ariya.github.com/canvas/crossfading/ 08/29/11 23
  • 24. Vector Graphics http://raphaeljs.com/polar-clock.html 08/29/11 24
  • 26. WebGL for Visualization http://senchalabs.github.com/philogl/ 08/29/11 26
  • 27. Which is for what? CSS3 Canvas SVG WebGL Animation of UI elements ✔ 2-D visualization ✔ ✔ Imperative drawing ✔ 2-D scene-graph ✔ ✔ 3-D scene graph ✔ 2-D game ✔ ✔ ✔ 3-D game ✔ 08/29/11 27
  • 28. Hybrid Native + Web 08/29/11 28
  • 29. Going Hybrid? Platform Integration Security Advanced Technologies App Store/ Marketplace 08/29/11 29
  • 30. Real-world Hybrid Apps Ext Designer Sencha Animator 08/29/11 30
  • 31. WebKit Everywhere Browser Devices Runtime 08/29/11 31
  • 32. ~2000 commits/month History 100000 80000 60000 Revisions 40000 20000 0 0 1 2 3 4 5 6 7 8 9 10 Years 08/29/11 32
  • 33. Components of WebKit DOM CSS WebCore SVG HTML rendering JavaScriptCore WebKit Library 08/29/11 33
  • 34. Platform Abstraction Network Unicode Clipboard Graphics Theme Events Thread Geolocation Timer 08/29/11 34
  • 35. WebCore Different “Ports” graphics GraphicsContext Mac Chromium Qt Gtk Skia Cairo CoreGraphics QPainter graphics stack 08/29/11 35
  • 36. QWeb* classes QWebView (widget) QWebPage (object) QWebFrame (object) At least one, i.e. the main frame of the page 08/29/11 36
  • 37. Using QWebView QWebView webView; webView.show(); webView.setUrl(QUrl("http://meego.com")); 08/29/11 37
  • 38. Contents via String QWebView webView; webView.show(); webView.setContent("<body>Hello, MeeGo!</body>"); 08/29/11 38
  • 39. Contents via Resource <RCC> <qresource prefix="/"> <file>content.html</file> </qresource> </RCC> QWebView webView; webView.show(); webView.setUrl(QUrl("qrc:/content.html")); 08/29/11 39
  • 40. Capture to Image QWebPage page; QImage image(size, QImage::Format_ARGB32_Premultiplied); image.fill(Qt::transparent); QPainter p(&image); page.mainFrame()->render(&p); p.end(); image.save(fileName); http://labs.qt.nokia.com/2009/01/15/capturing-web-pages/ 08/29/11 40
  • 41. SVG Rasterizer http://labs.qt.nokia.com/2008/08/06/webkit-based-svg-rasterizer/ 08/29/11 41
  • 42. Search + Preview http://labs.qt.nokia.com/2008/11/04/search-with-thumbnail-preview/ 08/29/11 42
  • 43. Exposing to the Web World QWebFrame::addToJavaScriptWindowObject(QString, QObject*) Public functions Object properties Child objects 08/29/11 43
  • 44. Exposing to the Web World page()->mainFrame()->addToJavaScriptWindowObject("Dialog", new Dialog); class Dialog: public QObject { Q_OBJECT public: Dialog(QObject *parent = 0); public slots: void showMessage(const QString& msg); }; 08/29/11 44
  • 45. Exposing to the Web World <input type="button" value="Try this" onClick="Dialog.showMessage('You clicked me!')"> instance of Dialog object public slot 08/29/11 45
  • 46. Signal and Slot signal foobar.modified.connect(refresh); QObject instance JavaScript function foobar.modified.connect(obj, refresh); any object 08/29/11 46
  • 47. Triggering Action from Native class Stopwatch: public QObject Stopwatch::Stopwatch(QObject *parent) { : QObject(parent) Q_OBJECT , m_index(0) { public: QTimer *timer = new QTimer(this); Stopwatch(QObject *parent = timer->setInterval(1000); 0); connect(timer, SIGNAL(timeout()), SLOT(update())); timer->start(); signals: } void tick(int t); void Stopwatch::update() private slots: { void update(); emit tick(m_index++); } private: int m_index; }; 08/29/11 47
  • 48. Triggering Action from Native instance of Stopwatch object signal <script> Stopwatch.tick.connect(function(t) { document.getElementById('tick').innerText = t; }); </script> 08/29/11 48
  • 49. Coming Back to Native QVariant QWebFrame::evaluateJavaScript(QString) mostly key-value pair (like JavaScript objects) 08/29/11 49
  • 50. Platform Integration Menu and Menu Bar Dialogs Application System Access Notifications 08/29/11 50
  • 52. Consume Web 2.0 http://labs.qt.nokia.com/2009/03/08/creating-a-google-chat-client-in-15-minutes/ 08/29/11 52
  • 55. GPU Acceleration 08/29/11 55
  • 56. Game vs Web 08/29/11 56
  • 57. Primitive Drawing 08/29/11 57
  • 58. Backing Store when you pinch... 08/29/11 58
  • 59. Layer Compositing 08/29/11 59
  • 60. Logical 3-D smooth animation FTW! 08/29/11 60
  • 61. Conclusions Web technologies are moving really fast Various frameworks and libraries boost the productivity Hybrid approach helps the migration Tools need to catch-up 08/29/11 61
  • 62. THANK YOU! ariya.hidayat@gmail.com ariya.ofilabs.com @ariyahidayat 08/29/11 62