Can I develop a hybrid app that was used in conjunction with the native API and HTML5 in Ubuntu phone?

I know that it is possible to develop either native app or HTML5 app.

However, I want to know to develop a native app that has a HTML5 UI (hybrid) in Ubuntu Phone.


1 Answer 1


I'm not sure what you mean with "hybrid" (a C++ app which displays an webapp? distribute app code between C++/QML/javascript? ), but you can use the WebView component to display a webpage/webapp on a qml application. This should work on Ubuntu Phone also.

Take this simple application composed by: "app.qml", "app.html" and "app.js" (yeah I know, this "application" is pretty lame...). This was only tested with qmlviewer, so if you try to run it through an IDE you probably will have to modify something in regard the relative paths used.


import QtQuick 1.0
import QtWebKit 1.0

Rectangle {
        width: 800
        height: 600
        WebView {
                url: "app.html"
                anchors.fill: parent
                preferredWidth: 800
                preferredHeight: 600
                smooth: false
                settings.developerExtrasEnabled : true 
                settings.javascriptEnabled: true


<!doctype html>
<html lang="en">
        <meta charset="UTF-8">
        body {
                margin: 20px;
        <a href="#" id="test_me">Click me!</a>
<script src="app.js"></script>


var x = document.getElementById("test_me");
x.onclick = function(){
        console.log("Hi there");
        new_elem = document.createElement("h2");
        new_elem.textContent = "Hi there!";

Hope it helps.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .