Pritpal Bedi escreveu:Hello Everybody
This thread will contain all the discussions leading to building an
Android APK via Qt Creator, Harbour and HbQt. This message body will be edited for
inserting missing parts as and when discovered; instead of initiating a different isolated
message. The idea is to keep every needed bit at one place. Once we will be convinced
that what goes into this message is sufficient enough to understand the steps
required to build an APK, I will publish it as part of HbIDE and/or onto my site.
Assumptions:
1. One would use C drive for all these operations ( change links accordingly in case of other drive ).
2. For simplicity reasons, some components will be installed in easy graspable folders instead of their default locations.
3. To make things really simpler, I suggest ( and refer in following lines ) to use QtContribs installation folder for other components.
4. You have some proficiency with how to use Qt Creator.
After installing QtContribs create these subfolders in C:\hb32\android
C:\hb32\android
\sdk
\ndk
\ant
What Components are Needed:
1. Harbour binaries compiled by Android NDK.
2. Complete installation of Qt 5.3.0beta or later with MinGW 4.8.2.
3. Complete installation of Android SDK.
4. Complete installation of Android NDK.
5. Complete installation of Apache Ant Tool ( Ant ).
6. Complete installation of Java v1.7 or later.
1. Harbour binaries compiled by Android NDK.
We have them ready as part of QtContribs installer. You need not to re-do it again.
This does not stop you to build your own
2. Complete installation of Qt 5.3.0beta or later with MinGW 4.8.2.
Download Qt 5.3.0 beta from
http://download.qt-project.org/development_releases/qt/5.3/5.3.0-beta/qt-opensource-windows-x86-android-5.3.0-beta.exe and install it in its default location on drive C which should be like C:\Qt\Qt5.3.0.
3. Complete installation of Android SDK.
Download Android SDK from
http://developer.android.com/sdk/index.html#download and deflate it in C:\hb32\android\sdk folder.
4. Complete installation of Android NDK.
Download Android NDK from
http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86.zip and deflate in C:\hb32\android\ndk folder.
5. Complete installation of Apache Ant Tool ( Ant ).
Download ANT from:
http://www.poolsaboveground.com/apache//ant/binaries/apache-ant-1.9.3-bin.zip and deflate in C:\hb32\android\ant folder.
6. Complete installation of Java v1.7 or later.
Most probably Java is already installed on your computer, but if not download it from
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html and install it in its default folder which will be somewhere in Program Files.
Once all above components are in place we are ready for experiencing our first Android build.
But wait, we need to setup a proper build project folder where all files created by Qt Creator
will reside. Note that Qt Creator can build projects for different targets and platforms and
name its build folders accordingly. So it is important to understand its importance.
I suggest to have C:\hb32-android folder parallel to C:\hb32 folder. Then create as many
folders within it as many projects you might have. For our comprehension I create a project,
( hbqt\tests\browarray.prg based ), like this:
C:\hb32
...\bin
...
C:\hb32-android
...browarray
......hb-gui.cpp ( copy it from C:\hb32\android )
......hb-gui.pro ( __do__ )
In hb-gui.pro change:
LIBS += -LC:\hb32\lib\android\gccarm \
\
-lmyapp \
\
=>
LIBS += -LC:\hb32\lib\android\gccarm \
\
-lbrowarray \
\
This will be the only change you would do for any new project you will initiate.
Now execute Qt Creator. and follow these steps:
1. Navigate <Tools><Options><Android>.
2. In the resulting dialog enter these values:
I have some AVD's already created on my machine so are picked by the dialog above.
If you have just installed Qt Creator and have never done Android programmin, you may need
to create one AVD. Follow the buttons on the dialog.
To be continued...
Enjoy
Pritpal Bedi
a student of software analysis & concepts