SlideShare una empresa de Scribd logo
1 de 68
Descargar para leer sin conexión
Hybrid Apps (Native + Web)
       via QtWebKit

                    SF BAY MEEGO NETWORK
                         JUNE 22, 2011




      ARIYA HIDAYAT
   ENGINEERING DIRECTOR
whoami
Overview
Going Hybrid?

   Platform Integration      Security



                            App Store/
    Advanced Technologies   Marketplace
WebKit Everywhere

 Browser



 Devices



Runtime
~2000 commits/month
            History
            90000
            80000
            70000
            60000
Revisions




            50000
            40000
            30000
            20000
            10000
               0
                    0   1   2   3   4     5     6    7     8     9    10
                                        Years
Extensive Tests



 ≈ 20,000 tests    tests
                  904 MB   the rest
                           229 MB
Workflow
                             quality control


    1     Every commit needs to be reviewed



    2     Broken commit must be reverted

                     zero-regression policy
Level of Involvement
    Contributor
                       after 10-20 patches




                                              after 80 patches
                       Committer

               ≈ 150                                     Reviewer

     checks in reviewed patches              ≈ 90
                                                           accept or reject patches
WebKit Reviewers
              Apple
               39




                              Google
                                25
      Misc
       11

       1     RIM
                      Nokia
              7
                        7
Components of WebKit
        DOM              CSS

              WebCore             SVG

 HTML
                   rendering
                                        JavaScriptCore


                 WebKit Library
Platform Abstractions

       Network     Unicode      Clipboard


       Graphics     Theme        Events


       Thread     Geolocation    Timer
WebCore
Di erent “Ports”                                      graphics


GraphicsContext
                      Mac        Chromium            Qt     Gtk


                                   Skia                          Cairo
                  CoreGraphics
                                                 QPainter


                                          graphics stack
Use
Web Browsers
                          Arora




  Demo Browser         http://arora.googlecode.com

       demos/browser
QWebView, QWebPage, QWebFrame
                    QWebView (widget)




                  QWebPage (object)


                            QWebFrame (object)

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


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


 QWebView webView;
 webView.show();
 webView.setContent("<body>Hello, MeeGo!</body>");
Contents via Resource
                      <RCC>
                          <qresource prefix="/">
                              <file>content.html</file>
                          </qresource>
                      </RCC>


QWebView webView;
webView.show();
webView.setUrl(QUrl("qrc:/content.html"));
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/
SVG Rasterizer




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




     http://labs.qt.nokia.com/2008/11/04/search-with-thumbnail-preview/
Bridging the Two Worlds
Exposing to the Web world

QWebFrame::addToJavaScriptWindowObject(QString, QObject*)



                                  Public functions
                                  Object properties
                                    Child objects
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);
                 };
Exposing to the Web world

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




    instance of
                             public slot
   Dialog object
Signal and Slot
              signal


   foobar.modified.connect(refresh);

    QObject instance       JavaScript function


  foobar.modified.connect(obj, refresh);
                             any object
Triggering Action from Native
class Stopwatch: public QObject
{                                     Stopwatch::Stopwatch(QObject *parent)
    Q_OBJECT                              : QObject(parent)
                                          , m_index(0)
public:                               {
    Stopwatch(QObject *parent = 0);       QTimer *timer = new QTimer(this);
                                          timer->setInterval(1000);
signals:                                  connect(timer, SIGNAL(timeout()), SLOT(update()));
    void tick(int t);                     timer->start();
                                      }
private slots:
    void update();                    void Stopwatch::update()
                                      {
private:                                  emit tick(m_index++);
    int m_index;                      }
};
Triggering Action from Native
   instance of
 Stopwatch object
                                  signal


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

  QVariant QWebFrame::evaluateJavaScript(QString)


      mostly key-value pair
     (like JavaScript objects)
Other Bridging Solutions


                                           Custom network protocol
                                           QNetworkAccessManager




       http://labs.qt.nokia.com/2010/11/16/some-webkit-hybrid-stu /
Platform Integration

                   Menu and Menu Bar

                                              Dialogs
                          Application
   System Access



                               Notifications
Debugging


     Web Inspector




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

     O ine                Packaging
 Cache Manifest      QtWebKit boilerplate
  Local Storage
                               Tools

              PhoneGap
          AppUp Encapsulator
Real-world Hybrid Apps




      Ext Designer       Sencha Animator
Technologies
Key Technologies
JavaScript
Libraries and Frameworks
Content Editing




      http://labs.qt.nokia.com/2009/03/12/wysiwyg-html-editor/
Consume Web 2.0




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




           http://raphaeljs.com/polar-clock.html
Canvas-based Game




      http://ariya.blogspot.com/2010/09/invade-destroy.html
Diagrams & Visualization




    JavaScript InfoVis Toolkit   http://thejit.org/
CSS3 Animations




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

Accelerated Composition

                                          Element    GL texture


                                               Movement
                                          Transformation matrix

http://www.webkit.org/blog-files/leaves/
Sencha Animator
Device Access




          http://ariya.github.com/js/marblebox/
WebGL for 3-D




        http://webglsamples.googlecode.com/hg/aquarium/aquarium.html
PhiloGL: WebGL Framework




            http://senchalabs.github.com/philogl/
Tools
Web Inspector
Network Log

28: GET http://www.google.com/m/gp
292: Response 200 application/xhtml+xml; charset=UTF-8 0 bytes http://www.google.com/m/gp
311: GET data:image/gif;base64,R0lGODlhiA...
312: GET data:image/gif;base64,R0lGODlhJA...
312: GET data:image/gif;base64,R0lGODlhGA...
312: Response 0 image/gif 3611 bytes data:image/gif;base64,R0lGODlhiA...
312: Finish fail data:image/gif;base64,R0lGODlhiA...
312: Response 0 image/gif 284 bytes data:image/gif;base64,R0lGODlhJA...
312: Finish fail data:image/gif;base64,R0lGODlhJA...
312: Response 0 image/gif 178 bytes data:image/gif;base64,R0lGODlhGA...
312: Finish fail data:image/gif;base64,R0lGODlhGA...
317: Response 200 application/xhtml+xml; charset=UTF-8 0 bytes http://www.google.com/m/gp
324: Finish fail http://www.google.com/m/gp
328: GET http://www.google.com/m/gn/user?...
329: Finish success http://www.google.com/m/gn/user?...
Typical Scenario
                          This is
                         awesome!




                    un
             t to r
       f orge ests
           the t
Test Framework

specrunner SpecRunner.html
5 specs, 0 failures in 0.013s

specrunner SpecRunner.html
FAIL: 5 specs, 1 failure in 0.014s




               Selenium, Watir, Squish Web, JSUnit, Jasmine,
                                 QUnit, ...
Headless WebKit

if (phantom.state.length === 0) {
    phantom.state = 'pizza';
    phantom.open('http://www.google.com/m/local?site=local&q=pizza+in+new+york');
} else {
    var list = document.querySelectorAll('div.bf');
    for (var i in list) {
        console.log(list[i].innerText);
    }
    phantom.exit();
}




                               http://phantomjs.org
UI Designer
IDE: AKShell
IDE: Cloud9
Recorder and Replayer
Get + Compile
Using git

  git clone git://git.webkit.org/WebKit.git
  cd WebKit



                       ≈ 1.2 GB .git
Build

Tools/Scripts/build-webkit --qt




      --debug for “Debug” mode
Launch

Tools/Scripts/run-launcher --qt
Conclusion
Today
       Web technologies are moving really fast
Various frameworks and libraries boost the productivity
         Hybrid approach helps the migration
                Tools need to catch-up
Future
 More bindings to the native world
 Platinum-grade productivity tools
Ubiquitous mesh and cloud solutions
THANK YOU!

         ariya.hidayat@gmail.com


         ariya.blogspot.com


         ariyahidayat

Más contenido relacionado

La actualidad más candente

Bootiful Development with Spring Boot and React - UberConf 2018
Bootiful Development with Spring Boot and React - UberConf 2018Bootiful Development with Spring Boot and React - UberConf 2018
Bootiful Development with Spring Boot and React - UberConf 2018Matt Raible
 
Clojure Web Development
Clojure Web DevelopmentClojure Web Development
Clojure Web DevelopmentHong Jiang
 
Seven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseSeven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseMatt Raible
 
Comparing JVM Web Frameworks - Rich Web Experience 2010
Comparing JVM Web Frameworks - Rich Web Experience 2010Comparing JVM Web Frameworks - Rich Web Experience 2010
Comparing JVM Web Frameworks - Rich Web Experience 2010Matt Raible
 
Java REST API Framework Comparison - PWX 2021
Java REST API Framework Comparison - PWX 2021Java REST API Framework Comparison - PWX 2021
Java REST API Framework Comparison - PWX 2021Matt Raible
 
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...Matt Raible
 
Choosing a Java Web Framework
Choosing a Java Web FrameworkChoosing a Java Web Framework
Choosing a Java Web FrameworkWill Iverson
 
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019Matt Raible
 
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020Matt Raible
 
How to Win at UI Development in the World of Microservices - THAT Conference ...
How to Win at UI Development in the World of Microservices - THAT Conference ...How to Win at UI Development in the World of Microservices - THAT Conference ...
How to Win at UI Development in the World of Microservices - THAT Conference ...Matt Raible
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Matt Raible
 
Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019Matt Raible
 
Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011Matt Raible
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...Matt Raible
 
What's New in Spring 3.1
What's New in Spring 3.1What's New in Spring 3.1
What's New in Spring 3.1Matt Raible
 
Bootiful Development with Spring Boot and React - SpringOne 2017
Bootiful Development with Spring Boot and React - SpringOne 2017Bootiful Development with Spring Boot and React - SpringOne 2017
Bootiful Development with Spring Boot and React - SpringOne 2017Matt Raible
 
Apache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-onApache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-onMatt Raible
 
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020Matt Raible
 
JavaOne India 2011 - Running your Java EE 6 Apps in the Cloud
JavaOne India 2011 - Running your Java EE 6 Apps in the CloudJavaOne India 2011 - Running your Java EE 6 Apps in the Cloud
JavaOne India 2011 - Running your Java EE 6 Apps in the CloudArun Gupta
 
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatCase Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatVMware Hyperic
 

La actualidad más candente (20)

Bootiful Development with Spring Boot and React - UberConf 2018
Bootiful Development with Spring Boot and React - UberConf 2018Bootiful Development with Spring Boot and React - UberConf 2018
Bootiful Development with Spring Boot and React - UberConf 2018
 
Clojure Web Development
Clojure Web DevelopmentClojure Web Development
Clojure Web Development
 
Seven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseSeven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuse
 
Comparing JVM Web Frameworks - Rich Web Experience 2010
Comparing JVM Web Frameworks - Rich Web Experience 2010Comparing JVM Web Frameworks - Rich Web Experience 2010
Comparing JVM Web Frameworks - Rich Web Experience 2010
 
Java REST API Framework Comparison - PWX 2021
Java REST API Framework Comparison - PWX 2021Java REST API Framework Comparison - PWX 2021
Java REST API Framework Comparison - PWX 2021
 
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
 
Choosing a Java Web Framework
Choosing a Java Web FrameworkChoosing a Java Web Framework
Choosing a Java Web Framework
 
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
 
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
 
How to Win at UI Development in the World of Microservices - THAT Conference ...
How to Win at UI Development in the World of Microservices - THAT Conference ...How to Win at UI Development in the World of Microservices - THAT Conference ...
How to Win at UI Development in the World of Microservices - THAT Conference ...
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020
 
Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019
 
Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
 
What's New in Spring 3.1
What's New in Spring 3.1What's New in Spring 3.1
What's New in Spring 3.1
 
Bootiful Development with Spring Boot and React - SpringOne 2017
Bootiful Development with Spring Boot and React - SpringOne 2017Bootiful Development with Spring Boot and React - SpringOne 2017
Bootiful Development with Spring Boot and React - SpringOne 2017
 
Apache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-onApache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-on
 
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
 
JavaOne India 2011 - Running your Java EE 6 Apps in the Cloud
JavaOne India 2011 - Running your Java EE 6 Apps in the CloudJavaOne India 2011 - Running your Java EE 6 Apps in the Cloud
JavaOne India 2011 - Running your Java EE 6 Apps in the Cloud
 
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatCase Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
 

Similar a 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 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
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKitAriya Hidayat
 
Qt & Webkit
Qt & WebkitQt & Webkit
Qt & WebkitQT-day
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAriya Hidayat
 
Writing Tools using WebKit
Writing Tools using WebKitWriting Tools using WebKit
Writing Tools using WebKitAriya Hidayat
 
Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Chris Ramsdale
 
Google Developer Fest 2010
Google Developer Fest 2010Google Developer Fest 2010
Google Developer Fest 2010Chris Ramsdale
 
Google io bootcamp_2010
Google io bootcamp_2010Google io bootcamp_2010
Google io bootcamp_2010Chris Ramsdale
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationBen Hall
 
Using Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network SystemsUsing Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network Systemsantonry
 
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"Provectus
 
Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020Matt Raible
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVMJohn Lee
 

Similar a Hybrid Apps (Native + Web) via QtWebKit (20)

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
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKit
 
Qt & Webkit
Qt & WebkitQt & Webkit
Qt & Webkit
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
Writing Tools using WebKit
Writing Tools using WebKitWriting Tools using WebKit
Writing Tools using WebKit
 
Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010
 
JBoss World 2010
JBoss World 2010JBoss World 2010
JBoss World 2010
 
Google Developer Fest 2010
Google Developer Fest 2010Google Developer Fest 2010
Google Developer Fest 2010
 
Google io bootcamp_2010
Google io bootcamp_2010Google io bootcamp_2010
Google io bootcamp_2010
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS Application
 
The WebKit project
The WebKit projectThe WebKit project
The WebKit project
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
From Code to Kubernetes
From Code to KubernetesFrom Code to Kubernetes
From Code to Kubernetes
 
Using Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network SystemsUsing Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network Systems
 
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
 
Vaadin & Web Components
Vaadin & Web ComponentsVaadin & Web Components
Vaadin & Web Components
 
Power ai image-pipeline
Power ai image-pipelinePower ai image-pipeline
Power ai image-pipeline
 
Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVM
 

Más de Ariya Hidayat

Understanding Webkit Rendering
Understanding Webkit RenderingUnderstanding Webkit Rendering
Understanding Webkit RenderingAriya Hidayat
 
Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersAriya Hidayat
 
Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersAriya 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
 
Build HTML5 App (Intel Elements 2011)
Build HTML5 App (Intel Elements 2011)Build HTML5 App (Intel Elements 2011)
Build HTML5 App (Intel Elements 2011)Ariya Hidayat
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with QtAriya Hidayat
 

Más de Ariya Hidayat (6)

Understanding Webkit Rendering
Understanding Webkit RenderingUnderstanding Webkit Rendering
Understanding Webkit Rendering
 
Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile Browsers
 
Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile Browsers
 
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
 
Build HTML5 App (Intel Elements 2011)
Build HTML5 App (Intel Elements 2011)Build HTML5 App (Intel Elements 2011)
Build HTML5 App (Intel Elements 2011)
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with Qt
 

Último

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Hybrid Apps (Native + Web) via QtWebKit

  • 1. Hybrid Apps (Native + Web) via QtWebKit SF BAY MEEGO NETWORK JUNE 22, 2011 ARIYA HIDAYAT ENGINEERING DIRECTOR
  • 4. Going Hybrid? Platform Integration Security App Store/ Advanced Technologies Marketplace
  • 5. WebKit Everywhere Browser Devices Runtime
  • 6. ~2000 commits/month History 90000 80000 70000 60000 Revisions 50000 40000 30000 20000 10000 0 0 1 2 3 4 5 6 7 8 9 10 Years
  • 7. Extensive Tests ≈ 20,000 tests tests 904 MB the rest 229 MB
  • 8. Workflow quality control 1 Every commit needs to be reviewed 2 Broken commit must be reverted zero-regression policy
  • 9. Level of Involvement Contributor after 10-20 patches after 80 patches Committer ≈ 150 Reviewer checks in reviewed patches ≈ 90 accept or reject patches
  • 10. WebKit Reviewers Apple 39 Google 25 Misc 11 1 RIM Nokia 7 7
  • 11. Components of WebKit DOM CSS WebCore SVG HTML rendering JavaScriptCore WebKit Library
  • 12. Platform Abstractions Network Unicode Clipboard Graphics Theme Events Thread Geolocation Timer
  • 13. WebCore Di erent “Ports” graphics GraphicsContext Mac Chromium Qt Gtk Skia Cairo CoreGraphics QPainter graphics stack
  • 14. Use
  • 15. Web Browsers Arora Demo Browser http://arora.googlecode.com demos/browser
  • 16. QWebView, QWebPage, QWebFrame QWebView (widget) QWebPage (object) QWebFrame (object) At least one, i.e. the main frame of the page
  • 17. Using WebView QWebView webView; webView.show(); webView.setUrl(QUrl("http://meego.com"));
  • 18. Contents via String QWebView webView; webView.show(); webView.setContent("<body>Hello, MeeGo!</body>");
  • 19. Contents via Resource <RCC> <qresource prefix="/"> <file>content.html</file> </qresource> </RCC> QWebView webView; webView.show(); webView.setUrl(QUrl("qrc:/content.html"));
  • 20. 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/
  • 21. SVG Rasterizer http://labs.qt.nokia.com/2008/08/06/webkit-based-svg-rasterizer/
  • 22. Search + Preview http://labs.qt.nokia.com/2008/11/04/search-with-thumbnail-preview/
  • 24. Exposing to the Web world QWebFrame::addToJavaScriptWindowObject(QString, QObject*) Public functions Object properties Child objects
  • 25. 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); };
  • 26. Exposing to the Web world <input type="button" value="Try this" onClick="Dialog.showMessage('You clicked me!')"> instance of public slot Dialog object
  • 27. Signal and Slot signal foobar.modified.connect(refresh); QObject instance JavaScript function foobar.modified.connect(obj, refresh); any object
  • 28. Triggering Action from Native class Stopwatch: public QObject { Stopwatch::Stopwatch(QObject *parent) Q_OBJECT : QObject(parent) , m_index(0) public: { Stopwatch(QObject *parent = 0); QTimer *timer = new QTimer(this); timer->setInterval(1000); signals: connect(timer, SIGNAL(timeout()), SLOT(update())); void tick(int t); timer->start(); } private slots: void update(); void Stopwatch::update() { private: emit tick(m_index++); int m_index; } };
  • 29. Triggering Action from Native instance of Stopwatch object signal <script> Stopwatch.tick.connect(function(t) { document.getElementById('tick').innerText = t; }); </script>
  • 30. Coming back to the Native QVariant QWebFrame::evaluateJavaScript(QString) mostly key-value pair (like JavaScript objects)
  • 31. Other Bridging Solutions Custom network protocol QNetworkAccessManager http://labs.qt.nokia.com/2010/11/16/some-webkit-hybrid-stu /
  • 32. Platform Integration Menu and Menu Bar Dialogs Application System Access Notifications
  • 33. Debugging Web Inspector settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
  • 34. Deployment O ine Packaging Cache Manifest QtWebKit boilerplate Local Storage Tools PhoneGap AppUp Encapsulator
  • 35. Real-world Hybrid Apps Ext Designer Sencha Animator
  • 40. Content Editing http://labs.qt.nokia.com/2009/03/12/wysiwyg-html-editor/
  • 42. Vector Graphics http://raphaeljs.com/polar-clock.html
  • 43. Canvas-based Game http://ariya.blogspot.com/2010/09/invade-destroy.html
  • 44. Diagrams & Visualization JavaScript InfoVis Toolkit http://thejit.org/
  • 45. CSS3 Animations http://mozillademos.org/demos/planetarium/demo.html
  • 46. GPU FTW Accelerated Composition Element GL texture Movement Transformation matrix http://www.webkit.org/blog-files/leaves/
  • 48. Device Access http://ariya.github.com/js/marblebox/
  • 49. WebGL for 3-D http://webglsamples.googlecode.com/hg/aquarium/aquarium.html
  • 50. PhiloGL: WebGL Framework http://senchalabs.github.com/philogl/
  • 51. Tools
  • 53. Network Log 28: GET http://www.google.com/m/gp 292: Response 200 application/xhtml+xml; charset=UTF-8 0 bytes http://www.google.com/m/gp 311: GET data:image/gif;base64,R0lGODlhiA... 312: GET data:image/gif;base64,R0lGODlhJA... 312: GET data:image/gif;base64,R0lGODlhGA... 312: Response 0 image/gif 3611 bytes data:image/gif;base64,R0lGODlhiA... 312: Finish fail data:image/gif;base64,R0lGODlhiA... 312: Response 0 image/gif 284 bytes data:image/gif;base64,R0lGODlhJA... 312: Finish fail data:image/gif;base64,R0lGODlhJA... 312: Response 0 image/gif 178 bytes data:image/gif;base64,R0lGODlhGA... 312: Finish fail data:image/gif;base64,R0lGODlhGA... 317: Response 200 application/xhtml+xml; charset=UTF-8 0 bytes http://www.google.com/m/gp 324: Finish fail http://www.google.com/m/gp 328: GET http://www.google.com/m/gn/user?... 329: Finish success http://www.google.com/m/gn/user?...
  • 54. Typical Scenario This is awesome! un t to r f orge ests the t
  • 55. Test Framework specrunner SpecRunner.html 5 specs, 0 failures in 0.013s specrunner SpecRunner.html FAIL: 5 specs, 1 failure in 0.014s Selenium, Watir, Squish Web, JSUnit, Jasmine, QUnit, ...
  • 56. Headless WebKit if (phantom.state.length === 0) {     phantom.state = 'pizza';     phantom.open('http://www.google.com/m/local?site=local&q=pizza+in+new+york'); } else {     var list = document.querySelectorAll('div.bf');     for (var i in list) {         console.log(list[i].innerText);     }     phantom.exit(); } http://phantomjs.org
  • 62. Using git git clone git://git.webkit.org/WebKit.git cd WebKit ≈ 1.2 GB .git
  • 63. Build Tools/Scripts/build-webkit --qt --debug for “Debug” mode
  • 66. Today Web technologies are moving really fast Various frameworks and libraries boost the productivity Hybrid approach helps the migration Tools need to catch-up
  • 67. Future More bindings to the native world Platinum-grade productivity tools Ubiquitous mesh and cloud solutions
  • 68. THANK YOU! ariya.hidayat@gmail.com ariya.blogspot.com ariyahidayat