Necessitas Qt for Android x86

143 views
Skip to first unread message

Robert Wei

unread,
Mar 29, 2012, 8:35:21 PM3/29/12
to Android-x86
Hi,

I am attempting to port an Android Qt (Necessitas) app to x86. I
figure all I have to do is to build QT from source using the x86
flag. However, it was not nearly so simple. After some research, I
found a way to get the build working. However, it still seems like
something is wrong. If anyone else here has had success building QT
for x86 and deploying an app, I'd like to solicit your feedback on my
procedure below:


1) git clone git://anongit.kde.org/android-qt.git
# Is this the right repo? I notice it doesn't have qt-mobility or qt-
webkit.

2) Remove the following lines from: mkspecs/android-g++/qmake.conf and
mkspecs/features/qt.prf
contains(NDK_ROOT, ".*r6")|contains(NDK_ROOT, ".*r5.*")|
contains(NDK_ROOT, ".*r5") {
!contains(ANDROID_PLATFORM, android-4): !
contains(ANDROID_PLATFORM, android-5): !contains(ANDROID_PLATFORM,
android-8) {
message("Your NDK-version is out-dated. A work-around is
enabled. Consider updating your NDK (workarounds are required until
r6(a))")
QMAKE_LFLAGS_SHLIB += $$ANDROID_PLATFORM_PATH/lib/
crtbegin_so.o $$ANDROID_PLATFORM_PATH/lib/crtend_so.o
}
}

3) Edit android/androidconfigbuild.sh
NDK_ROOT=~/necessitas/android-ndk-r6b
NDK_PLATFORM=9
NDK_TOOLCHAIN_PREFIX="x86"
NDK_TOOLS_PREFIX="i686-android-linux"
TARGET_ARCH="x86"
ANDROID_ARCHITECTURE="x86"

4) ./androidconfigbuild.sh -q 1 -h 0
# -q 1 is for configure/compile
# -h 0 is for static version

5) Wait for the build to finish

6) Copy to ~/necessitas/Android/Qt/480/x86

7) In Qt Creator, Open Project

8) Go to Projects | Build Settings | General | Manage Qt version

9) Add ~/necessitas/Android/Qt/480/x86
#Observe the following error: Qt version is not properly installed,
please run make install


QT Creator version information
Qt Creator 2.3.1
Based on Qt 4.7.4 (32 bit)
Built on Oct 16 2011 at 16:03:12


Thanks for helping me out and I hope this information is useful for
anyone else attempting to do the same.

-- Robert
Reply all
Reply to author
Forward
0 new messages