application development pekka kosonen nokia

Upload: see2009

Post on 30-May-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    1/23

    Pekka Kosonen

    Head Of Technology Development

    Nokia

    Next Generation Hybrid Applications

    Utilizing your Web Development Skills with Qt based Solutions

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    2/23

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    3/23

    In the year 2010

    - Hybrid application?

    A mashup? A Widget? Thin/Thick client? A full blown

    application?

    Always connected?

    Utilizes web services?

    Differ in mobile vs. desktop context?

    Combines several technologies - web and native?

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    4/23

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    5/23

    Today

    Adobe AIRAdobe AIR is a standalone runtime library

    Web RuntimesMany vendors provide web runtimesUsually a sandbox environment where you can plugin web w idgetsSome amount ofplatform services offered

    Microsoft SilverlightWeb browser plug-in that follows along the lines of FlashDesigned to be an application platform from day one

    Developing Hybrid Applications for the iPhoneUsing HTML, CSS, and JavaScriptto Build Dynamic Apps for the iPhone

    http://tv.adobe.com/watch/max-2008-develop/hybrid-applications-where-javascript-flash-play-together/http://www.informit.com/store/product.aspx?isbn=0321604164http://tv.adobe.com/watch/max-2008-develop/hybrid-applications-where-javascript-flash-play-together/
  • 8/14/2019 Application Development Pekka Kosonen Nokia

    6/23

    Industry buzz?

    a hybrid app is everything that a web application is, but

    carries the concept of"more program than web site"

    and a gazillion other widget runtimes

    http://www.communitymx.com/http://www.apple.com/fi/itunes/overview/http://www.communitymx.com/
  • 8/14/2019 Application Development Pekka Kosonen Nokia

    7/23

    What are the good things to steal

    from the web world?

    HTML5

    JavaScript

    WebKit

    EaseSpeed

    Resource pool

    Innovation

    Portability

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    8/23

    but the real world is still

    fragmented and not complete

    Device API accessHow easily can you extend it?

    Install baseDiscoverability

    Security

    UX

    Speed

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    9/23

    Continued googling...

    Found out that theres a presentation coming about hybrid applications.

    Need to go there!

    Then I noticed its mine

    http://www.see2009.org/page.cfm/action=Seminars/SeminarID=145

    Next Generation Hybrid Applications Utilizing your Web Development Skills

    with Qt based Solutions

    http://www.see2009.org/page.cfm/action=Seminars/SeminarID=145http://www.see2009.org/page.cfm/action=Seminars/SeminarID=145
  • 8/14/2019 Application Development Pekka Kosonen Nokia

    10/23

    Hybrid app seems to be something like

    A mashup? A Widget? Thin/Thick client? A full blown application?

    Seems like more than a mashup or a widget.

    Always connected?

    Doesnt need to be connected.

    Utilizes web services?

    Most likely. At least needs to have the means to

    Combines several technologies - web and native?Seems so...

    Differ in mobile vs. desktop context?Different features that are important (like location on mobile)

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    11/23

    Hybrid Development

    in Qt context

    Easily approachable web technologieswith powerful and scalable Qt C++A rich selection of features for hybrid development

    QtWebKit module:embed web content from servers,local files or applications resourcesinto Qt applications

    QtScript module:make Qt applications scriptableQtXMLPatterns module:shape and mash up XML date yielding HTML outputQNetworkAccessManager:

    interact with server side URL APIs

    Public

    Size of

    Project

    Approachability of

    Programming

    Environment

    LargeSmall

    Easy

    DifficultQt C++

    Unattainab

    le

    AreaWRT

    Browser/ Standalone

    Web runtime

    Application *)

    Qt C++Application

    HTML, CSS,

    JavaScript

    Widgets accessingplatform serviceswith JS

    Hybrid Applications

    QWebView *view = new QWebView(parent);

    view->load(QUrl("http://qt.nokia.com/"));view->show();

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    12/23

    Interact with Web Services

    QtWebKit allowsIntuitive use ofnetwork resources,Easy to embed web content into an applicationExposing QWidget to HTML

    and QObject to JavaScriptCalling JavaScript from Qt and vice versaContent may be enhanced w ith native controls

    JS

    Qt

    OS specificAPIs

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    13/23

    QWebFrame *frame = view->currentFrame();

    //You can inject JavaScript to be executed

    frame->evaluateJavaScript(myAmaging JS Stuff);

    //You can expose any QObject to the web view

    MyQTwitter *twit = new MyQTwitter()

    frame->addToJavaScriptWindowObject(twit,twit);

    function setStatus() {

    twit.updateStatus( statusupdate.text );

    }

    statusupdate.returnPressed.connect(this,setStatu

    s);

    Javascript

    //do what ever you want with native APIs

    //that you can call directly from Qt

    CRRSensorApi::FindSensorsL(sensorList);

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    14/23

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    15/23

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    16/23

    Webview Demo

    Core app ready install new JS in

    In the demo theres BBC News, games likeRock-Paper-Scissors, Tic-Tac-Toe, Calculator and BubbleAnything from web can be pulled to the hybrid container

    Statistics:300 lines of Qt code

    Size of .sis file: 20 kBDevelopment time: approx. 5 hours

    Qt C++ HybridApplication

    HTML, CSS,JavaScript

    Browser/ StandaloneWeb runtime application *)

    Cool guys swing both ways

    Go hybrid with Qt and Web!

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    17/23

    Are we making a Web Runtime?

    1) Web developer injects JS+HTML+CSS to the framework.If it spits out an executable were not making a web runtime (I think).

    2) The framework is installed to device -> developer writesplugins (with JS/HTML/CSS) we are closer to making own WRT (I think)

    Whats important in the FWIndustry compliancy especially in the APIs that are offered to JSdevelopers

    Extendability The features what are offered out of the box are

    NEVER enough. You want to extend and well let you.

    UI libraries easy to use nice looking stuff (TODO show flickr demoand refer to declarative UI)

    Security

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    18/23

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    19/23

    As a hybrid app developer you

    ...can use your web skills (HTML, CSS, ) to do the UIOr, since QWebView has NPAPI -> FlashOr, you can go nuts and even push native Qt components to webview

    ...write JS to access platform featuresIf theres a not a ready service provider implemented feel free to do it(and publish it for others please!)?

    ...get a Qt application which is a native application!No runtime performance hitsSources are protected

    And it works where ever Qt is supported!Distribute it to Ovi store and target 130 million smartphones with Qt 4.6!Remember to open the bank vault before the money trucks arrive!

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    20/23

    The things to take home with you

    Qt is available everywhereOn desktops OSs as well as smartphonesWith Qt and Mobility APIs you can make full blown mobile applications

    With Qt webkit web developers can create native applicationsNo feature restrictions

    Were making this easier with a framework thatTakes in pure web content : JS, HTML, CSS, Spits out a native Qt applicationProvides the usual platform services out of the box

    Can be extended with your own service providers (Qt Service FW

    plugins)

    Later onProvide a JS UI libraryDeeper tool integration (Qt Creator)

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    21/23

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    22/23

  • 8/14/2019 Application Development Pekka Kosonen Nokia

    23/23