[Development] QT5 Beta 1 & Android

Shawn Rutledge shawn.t.rutledge at gmail.com
Sun Nov 11 02:21:18 CET 2012


I was able to do the build using NDK r8b, but I ran into the following NDK
bugs along the way:

http://code.google.com/p/android/issues/detail?id=35616 (applied both
workarounds)
https://android-review.googlesource.com/#/c/41833/
https://android-review.googlesource.com/#/c/41613/

I didn't find a good solution to the fenv issue yet, but worked around it
by commenting out some stuff in src/corelib/tools/qlocale_tools.cpp.  The
examples work.

In the PDF you wrote

Screen Orientation Change: The activity will call onDestroy and onCreate,
without unloading shared libraries or going through static initialization!

so does that mean it's actually going to destroy and re-create the UI?  It
doesn't seem to work in the qquickview_example; I just get a black screen
if I change orientation from whichever orientation it was when I started
the app.  So far I've been thinking on platforms on which it's possible to
rotate the whole windowing environment (e.g. desktops), an application will
not necessarily need to care, but can detect changes in QScreen properties;
whereas on platforms which do not auto-rotate everything, a Qt Quick app
will need to rotate its own content (by binding to the relevant QScreen
properties, probably just primaryOrientation).  Does Android not fit either
of those models?

Anyway, this looks like a good starting point to me.  So thanks for the
contribution!

On 9 November 2012 15:08, Walter Horsten <walter.horsten at gmail.com> wrote:

> Hi Eskil, Shawn,
>
> Eskil, I use CMake scripts (part of a larger build framework that I
> developed) for most of the tooling: generating the manifest etc and the
> java wrapper activity .
>
> Shawn, Indeed I started from scratch. I minimized the use of JNI calls as
> much as possible, which probably does mean that a recent NDK is necessary.
> There still is some JNI code needed though (the NDK functions for the soft
> keyboard don't seem to work?, creating intents etc ) and I need a wrapper
> activity in Java to load the shared libraries and deploy plugins somewhere
> where Qt can find them. More details of the implementation can be found in
> the pdf file in the tarball in attachment.
>
> I have some scripts set up that make it quite easy for me to cross compile
> libraries, for now however I've just configured a "basic qt" (without
> webkit and without openssl - the latter because I compile it statically and
> something seems to go wrong in the qt buildprocess when I use
> --openssl-linked), because I didn't want to spend too much time on the
> actual building process. The modules that I focused on are qtcore, qt3d and
> qtdeclarative (and their dependencies).
> The widgets library compiles but I have not done any work to integrate
> anything like the native widgets on the desktop platforms.
>
> These are the patches that I've made against
> qt-everywhere-opensource-5.0.0-beta1.tar.gz and a build script, maybe some
> of it is useful to the Qt project. Feel free to experiment with them, if
> you would like to integrate them in Qt5 I don't mind as long as I get the
> proper credit :-).
>
>
>
>
> I cannot promise how actively I can contribute (I'm did  this work in my
> spare time) ... but I am certainly interested in keeping in touch about the
> "Android effort" and helping out where I can.
>
> Later,
> Walter
>
>
> On 09 Nov 2012, at 14:28, Eskil Abrahamsen Blomfeldt wrote:
>
> > On 11/09/2012 02:11 PM, Walter Horsten wrote:
> >> Hi all,
> >>
> >> I have QT5 Beta1 apps running on android, installable via an apk,
> launchable from the app screen and properly interacting with the OS. I
> don't know to what extent it is complementary to Necessitas (which I read
> is going to be integrated in Qt5 as well), but if it is I'm willing to
> contribute this work to QT5.
> >>
> >> Visit this link for a short demonstration:
> http://www.youtube.com/watch?v=ZTpGEDUJmcY
> >>
> >> I have patches, a short document on the design, a few sample apps (the
> ones shown in the video) and a buildscript prepared.
> >> Let me know if anyone is interested in this work.
> >
> > Hi, Walter.
> >
> > I'm going to be showing a similar proof-of-concept on DevDays which is
> based on the EGLFS platform plugin with JNI bindings for stuff like input
> which is basically copy-pasted from the Necessitas plugin.
> >
> > I think getting a good experience from a Qt for Android-integration is
> at least 70% tooling: making plugins for Qt Creator which generates up the
> necessary Java files to start your app, hooks into adb, allows you to
> generate the manifest, etc.
> >
> > I would very much be interested in seeing what you have, and if you'd be
> interested in contributing to the project to get proper Android-support for
> Qt 5, that would be great :) It's still in the early stages here at Digia,
> but if you want I can keep in touch when the project accelerates.
> >
> > Thanks!
> >
> > -- Eskil
> >
>
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121111/15ffa4b0/attachment.html>


More information about the Development mailing list