[vc_row][vc_column][vc_column_text]To make things simple, we use a virtual box on a windows PC to install 64-bit Ubuntu PC. So all the work done below is on a 64 bit machine if it is done on a X86 PC.[/vc_column_text][vc_tour][vc_tab title=”Install Android SDK on 64-bit Ubuntu PC” tab_id=”1396337548-1-24″][vc_column_text]Step 1:
$sudo apt-get install ia32-libs
Step 2:
Install openjdk-7-jdk:
$sudo apt-get install openjdk-7-jdk
Step 3:
Download the Android ADT Bundle from here and unzip it to wherever you want.
$pcduino@pcduino-VirtualBox:~$ wget http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20130729.zip $pcduino@pcduino-VirtualBox:~$ unzip adt-bundle-linux-x86_64-20130729.zip
Step 4:
Check that the unzipped ADT Bundle folder have the folders tools and platform-tools. These folders contain some important commands stored. Export them. Exporting them can be done as follows:
First execute ‘sudo gedit ~/.bashrc’. A file opens. Just add these lines to that file:
export PATH=$PATH:/path/to/tools export PATH=$PATH:/path/to/platform-tools
Close the current terminal, and open a new one, the setting we just made will take effect. Test if the new path works or not by typing ‘$adb’.
Make sure you install API levels 10, 11 and 16 by running’ $android’ under tools directory under sdk.
[/vc_column_text][/vc_tab][vc_tab title=”Android NDK” tab_id=”1396337548-2-68″][vc_column_text]You also need an Android NDK. You can use the official NDK from Google, but for full support of all debugging features, please use the customly built NDK at the following location: http://code.google.com/p/mingw-and-ndk/downloads/list.
pcduino@pcduino-VirtualBox:~$ wget http://mingw-and-ndk.googlecode.com/files/android-ndk-r8e-ma-linux-x86_64.tar.xz pcduino@pcduino-VirtualBox:~$tar -xf android-ndk-r8e-ma-linux-x86_64.tar.xz
[/vc_column_text][/vc_tab][vc_tab title=”Qt Creator 2.7.2″ tab_id=”1396338056953-2-1″][vc_column_text]Get Qt Creator 2.7.2 (or later): http://qt-project.org/downloads#qt-creator
pcduino@pcduino-VirtualBox:~$ wget http://download.qt-project.org/official_releases/qtcreator/2.8/2.8.1/qt-creator-linux-x86_64-opensource-2.8.1.run
[/vc_column_text][/vc_tab][vc_tab title=”Qt5″ tab_id=”1396338111923-3-8″][vc_column_text]
$git clone git://gitorious.org/qt/qt5.git qt5 $cd qt5 $perl init-repository $./configure -developer-build -xplatform android-g++ -nomake tests -nomake examples -android-ndk /home/pcduino/android-ndk-r8e -android-sdk /home/pcduino/adt-bundle-linux-x86_64-20130729/sdk -android-ndk-host linux-x86_64 -android-toolchain-version 4.7 -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples
Before we build QT, we need to install:
$sudo apt-get install g++
We also need to define couple of environmental variables:
pcduino@pcduino-VirtualBox:~/qt5$ export ANDROID_API_VERSION=android-18 pcduino@pcduino-VirtualBox:~/qt5$ export ANDROID_BUILD_TOOLS_REVISION=android-4.3
Now we can start to build:
$make
[/vc_column_text][/vc_tab][vc_tab title=”Install QTCreator” tab_id=”1396338325339-4-2″][vc_column_text]After we finish building QT5, we can install qtcreator as shown below:
Follow the instructions there, we arrive at:
[/vc_column_text][/vc_tab][vc_tab title=”Existing Sample Project” tab_id=”1396338416100-5-4″][vc_column_text]Now we use an existing sample project.
Step 1: Download source code (including 64-bit arm toolchain for android)
$ git clone https://github.com/liaods/c_enviroment_android.git
We can download the more complete qt project at here to replace ‘qt_android_test’ in c_enviroment_android.
Launch qtcreator:
Open pcduino_qt_android:
Click the button ‘Yes’:
Select ‘Android for arm (GCC 4.7, QT5.1.2)’ instead, and then click ‘Configure project’:
If you are not able to see the select ARM GCC interface, we need to configure the toolchains by navigating to Tools->Options:
You may need to install ‘ant’ by doing ‘$sudo apt-get install ant’.
We also need to configure QT:
We can build the project by navigating to “Build-> Deploy all”:
If we go to ‘qt_android_test/android/bin’, we will see the generated apk file:
We can copy the apk though pcDuino OTG or SD card to pcDunio and install it there.
[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.