Qt for PhoneGap

Published Thursday January 12th, 2012
23 Comments on Qt for PhoneGap
Posted in Community, Partners | Tags: , ,

PhoneGap Biolab, by Yohei Shimomae. License: CC BY-NC

Qt meets PhoneGap! Or at least this is the goal of a community project that ICS has started with the ambition of attracting both PhoneGap and Qt developers. The plan is to get Qt as a target of the PhoneGap SDK (or Apache Cordova, as it is being renamed) following roughly the Qt 5 development schedule and keeping an eye to a Qt 4 backport. The result would allow PhoneGap developers to add Qt based platforms to their targets with little or no extra effort. Needless to say contributors are welcome! Both PhoneGap and Qt are free software developed openly.

Some background

As explained at phonegap.com:

PhoneGap is an HTML5 app platform that allows you to author native applications with web technologies and get access to APIs and app stores. PhoneGap leverages web technologies developers already know best… HTML and JavaScript.

With the PhoneGap SDK you can take a generic HTML5 app, connect it to native platform APIs and generate native packages ready to be published for the platforms targeted. As of today PhoneGap fully supports iOS, Android and Windows Phone, and has partial coverage for Blackberry OS, Web OS, Bada and Symbian (through WebKit).

PhoneGap is being mainly used to develop apps deeply connected to websites, catalog-like apps, basic games… This is not only about handsets, the usage for tablets is growing as well. Check their list of featured apps. Take for instance the case of the Wikipedia app, which I have followed as an occasional Wikimedia volunteer. The Wikimedia Foundation started working on an app for iOS. When they finally addressed a version for Android they decided to avoid entirely the development of another app written from scratch and they went for a PhoneGap. This will be now their basis for any mobile platform.

From a Qt perspective the PhoneGap approach sounds as familiar as provocative. As we know, one of the things that makes Qt great is the potential for cross-platform compatibility. In the past years we have also seen how Qt has grown in the orthogonal axis of platform integration: from the imperative C++ to the declarative and javascriptish Qt Quick, with a full fledged and competitive QtWebKit module serving as gateway to the pure Web languages. Other approaches have been added by the community, like for instance the Python bindings. In a way PhoneGap is an alternative technology, but on the other hand they can be combined in very interesting ways. We like experiments so here goes one more.

Bringing Qt closer to mainstream mobile developers

PhoneGap has grown mainly thanks to customers willing to pay or develop one single app running on iOS and Android. Now the Windows Phone target is getting at the same level of support, meaning that developers checking an extra box will get an extra package ready for WP devices. Wouldn’t it be nice to add a box or more for Qt enabled platforms? Offer a straight path to convert that HTML5 generic code in a native Qt app packaged and ready to be published?

Which Qt platforms, how well supported and how soon depends on many factors, being the most relevant *you*. Being a user of Nokia devices I would like to see PhoneGap apps populating the Nokia Store and apps.formeego.org of course. But for instance, being also an Ubuntu user I would be also extremely happy seeing that flow nurturing also their Software Centre. And… (what would you like to see?)  🙂

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Community, Partners | Tags: , ,


rahul says:

To finish your “and .. what would you like to see?”, may I add Blackberry Playbook also has full support of Qt in NDK 2.0 so that too 🙂

Quim Gil says:

rahul, interesting but unrelated. 🙂

Is jQuery Mobile project will be suported too? Symbian has grade B in jQM so it isn’t really perfect now. But it is nice combination to build PhoneGap+jQueryMobile apps or Sencha Touch and deploy also on Symbian/MeeGo.

phlox says:

I like QML and Qt Quick, great stuff.
Still, you can’t really make use of it, without C++.
As a developer, I don’t like the Qt Marketing which tries to make C++ look bad imho. Without C++ Qt wouldn’t exist. And still, for Performance, all you have in Qt is C++. And Performance is the key to the future. Nothing is more important than Performance on those devices out there.
Makes your app fast, and keeps the battery a bit longer alive.

Quim Gil says:

This is about extending the possibilities around Qt. The average web developer is close to PhoneGap and far from C++. As you say, the bigger the needs for optimization and performance the bigger developers will need to get closer to C++. Nothing wrong with this! Nothing wrong in making it easier for web developers to get their software in Qt enabled devices.

jQuery, I have no idea but if someone is interested I guess it can be pushed? Just like some of us are pushing this Qt for PhoneGap project (which is not an official Qt Project activity, just in case this isn’t clear).

I agree with Quim and support this project. This has nothing to do with which language is best. This is about offering more opportunity for Qt use: some devices and circumstances may offer PhoneGap support and I’m sure people would be delighted to be able to use Qt in the PhoneGap native plugins, just like the Qt port for the Chrome / Chromium Native Client is possible too.

serkol says:

Maybe I’m old and stupid, but I don’t get this.

PhoneGap already works on iOS, Android, Blackberry old and new OS, WP7, Symbian and Bada.

You don’t need Qt to run PhoneGap on those platforms.

So who will benefit from this project? This project can enable PhoneGap on platforms that are supported by Qt but are not listed above. What are those platforms? Meego?

pankaj says:

And what would be the platform on which Qt works – BB and Symbian as Meego is already dead? But PhoneGap is already on BB and Symbian. Also while everything else listed as supported by PhoneGap is a device OS, I am not sure Qt fits that description.

Quim Gil says:

But but but… following your rationale what is the point of developing Qt 5 altogether? 🙂

The point is simple: the Qt Project believes that there will be platforms and products shipping Qt in the future. In software development terms the equation is quite simple: the way to be ready when Qt 5 is ready is to start now. Qt 5 feature freeze is just few weeks away and this is what is needed to start building Qt 5 support for PhoneGap on top of a good foundation.

(posting from home, sorry for different userid)

An says:

Will it be a fork of current phonegap-qt or it will be a total new separated project?

Danny Bennett says:

This is great news as I see it. Embedded Linux platforms are not limited to Android. In fact most of the growth areas like IVI, Smart TV/Media Centers are wide open regarding platforms. However, Qt is increasingly becoming a common toolkit in these areas. In fact we have been analyzing similar ideas around PhoneGap last year based on customers requests in these areas. I think this is a good idea and fully support it. Where can I contribute? 🙂

Quim Gil says:

Where to contribute is answered at http://wiki.qt-project.org/PhoneGap_for_Qt_5 – see you there! 😉

In that wiki page you can see that the current phonegap-qt work (based on Qt 4) is referenced and in fact the dialog with the maintainer has started at the apache-call back mailing list (also linked in the wiki page). I’m not the technical expert here but it looks like the jump from Qt 4 to Qt 5 is significant since we are talking also about the jump from WebKit to WebKit2. Anyway, it is a technical discussion that needs to happen in that mailing list between the maintainers and whoever wants to have a say.

Bundyo says:

Its not that significant – WebKit2 is only the process separation branch and Qt 4.7 in Harmattan already uses it. But probably there are other differences between Qt 4 and 5 underneath it.

Allan Jensen says:

It is actually very significant. Besides bringing process separation WebKit2 is a primarily a new API within the WebKit trunk, and the only API still being developed (WebKit1 is also available in trunk but becoming outdated).

Quim Gil says:

While the two main developers of PhoneGap for Qt 4 think that the move to Qt 5 is not a big deal, Kenneth Christiansen (WebKit reviewer and browser developer at Nokia) thinks it is complex: http://phonegap.ics.com/2011/12/a-week-of-compiling.html#comments

What do I know here and now? 🙂 The answer needs to come through technical discussion at the PhoneGap development list. I started a thread there, please follow up: http://mail-archives.apache.org/mod_mbox/incubator-callback-dev/201201.mbox/browser

Javi Moya says:

“Code once, run everywhere”…
That’s was archieved by QT/C++ on win, mac and linux.

Phonegap apps looks ugly…
most of them with the iOS css-style for all platforms…

I really appreciate your efforst to make QT “broader”
but I think this is not the right way.

Just make QT/QML able to deploy apps -with full official and enthusiast support from Nokia- to looks native on iOS,Android &future-disruptive-tecnology-of-Nokia.

“Code once, run everywhere”… in the post-Desktop era:
iOS-Android-Nokia ecosystem.
That’s the right way.

Quim Gil says:

Javi, this is not a project to convince Qt developers to use PhoneGap. This is a project to help convincing PhoneGap developers to target Qt platforms.

I believe this project also will help getting a % of those developers familiar, interested and engaged in Qt / Qt Quick development as well, once they see what else is more for them.

PhoneGap itself doesn’t touch the UI of your app and therefore it won’t try to make it look native. Your PhoneGap app looks as you design it, just like a web page. If you want native look & feel for different platforms then you may want to consider something like Sencha Touch…

… or as you suggest you could indeed use Qt Quick!

As I see it this project adds possibilities and doesn’t remove any. It is not taking any resources away from Qt / Qt Quick development or the Android / iOS ports. And it is not targeting the same audiences.

JB says:

The project may be good, but not important. I think you should take more effort and man-month on QML2+lighthouse. Try to improve performance and stability, try to make it easier to use(more components), try to release Qt5 ASAP. That’s the most crucial thing. If somebody like HTML5, just give them Qtwebkit, that’s enough.

Quim Gil says:

JB: of course the tasks you mention are a lot more important. Nobody is questioning that.

This project is an experiment, as explained above. It is pushed primarily by ICS developers that find the goal interesting and others (like me, who can’t contribute much to e.g. Lighthouse/QPA). It doesn’t take away any resources or even attention from the areas you mention.

PS: Except for some QtWebKit maintainers, who actually are interested in seeing where this project leads since it puts into early test the work they are doing on Qt 5 and WebKit2.

BSA says:

Will Qt support for PhoneGap fall into the field of Desktop web applications or not? I mean will we be going to use Qt with PhoneGap to target Smart Phones and also desktop OS?

Information from PhoneGap web site say its just for smartphone platforms and there is no any information regarding desktop platforms.

So I am here to know is it will be possible to use PhoneGap framework with Qt to build applications targeting smartphones and desktops platforms altogether.


Quim Gil says:

The question is: why do you need PhoneGap for a desktop app? Their specialization is on the APIs that mobile platforms use in different ways: geolocation, camera, accelerometers and so on. If you are looking for cross-desktop compatibility then Qt alone is good for you.

Alessandro says:

I had to port our iphone/android/bb helpdesk and remote control app on a PC/MAC environment. Qt/Phonegap really speeds up the process because I reused all the html/css3/javascript stuff and I wrote only the specific plugins that do the underlying processes. Obviously it would be possible to do it without Phonegap but I think it really simplifies hooking javascript to C++ and vice versa.

name says:

> The question is: why do you need PhoneGap for a desktop app?

PhoneGap in combination with Qt could easily target mobile AND desktop, but unfortunately it does not.
PhoneGap/cordova already targets all mayor mobile systems (iOS, android, ..), Qt already targets all mayor desktop systems (linux, mac, win).
But cordova-qt limits itself to Qt on mobile devices.
Maybe you have the resources to support cordova-qt on desktop machines as well.
This would really be write once, run everywhere.

> If you are looking for cross-desktop compatibility then Qt alone is good for you.

People are not only asking for cross-desktop but for cross-mobile and cross-desktop compatibility.

Commenting closed.

Get started today with Qt Download now