Marble/AndroidCompiling: Difference between revisions

From KDE TechBase
No edit summary
(Page moved to community wiki)
 
(36 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Construction}}
{{ Moved To Community }}
 
This page present how to compile Marble for Android, using the Android SDK, Android NDK and Qt for Android, and how to deploy it to your device.
 
=== Prerequisites ===
 
You will need the following tools:
# Android SDK - It can be downloaded from here: http://developer.android.com/sdk/index.html
# Android NDK - You can download it from here: https://developer.android.com/ndk/index.html
# Qt with support for Android devices. Download the best one for you: https://www.qt.io/download-open-source/#section-2 and install it, but be sure that the Android support is installed too (for example you have to check in to install it in the online installer).
# CMake - Usually you should be able to install it from your respository.
# Java Development Kit - For example you can install openjdk, usually it should be in your respository.
# Ant - This should be available from the respositories too.
 
Some Android platforms will be needed, you should install them with the Android SDK's package manager. It can be started with:
#<syntaxhighlight lang="bash">/path_where_you_installed_the_sdk/tools/android sdk</syntaxhighlight>
 
Make sure to install the following platforms:
# 10
# 11
# 16
# 18
# 19
 
=== Getting the Marble Source Code  ===
# Start a terminal
#We download the source code by cloning the developer repository with the following command:
<syntaxhighlight lang="bash">git clone git://anongit.kde.org/marble ~/marble/sources</syntaxhighlight>
 
After you run the git clone command (shown above), all the Marble source files and considerable resource files will be found in a folder called marble in your home directory.
 
=== Setting your PATH ===
You have to add the following paths to your PATH:
 
Android NDK:
<syntaxhighlight lang="bash">export ANDROID_NDK=/path_to_your_NDK_install</syntaxhighlight>
Android SDK:
<syntaxhighlight lang="bash">export ANDROID_SDK=/path_to_your_SDK_install</syntaxhighlight>
Ant:
 
You can get the path to the binary with:
<syntaxhighlight lang="bash">whereis ant</syntaxhighlight>
After you know the path:
<syntaxhighlight lang="bash">export ANT=/path_to_ant</syntaxhighlight>
Java:
 
Path to your Java installation, for example:
<syntaxhighlight lang="bash">export JAVA_HOME=/usr/lib/jvm/java-7-openjdk</syntaxhighlight>
Qt:
 
For example, if you installed Qt in /opt/Qt you have to set the following on a 64 bit system:
<syntaxhighlight lang="bash">export QT5_HOST=/opt/Qt/5.4/gcc_64</syntaxhighlight>
And for the Android version:
<syntaxhighlight lang="bash">export QT5_ANDROID=/opt/Qt/5.4/android_armv7</syntaxhighlight>
 
 
=== Compiling Marble ===
First of all, create a build directory in marble's source dir:
<syntaxhighlight lang="bash">mkdir ~/marble/build</syntaxhighlight>
Than change your working directory to it:
<syntaxhighlight lang="bash">cd ~/marble/build</syntaxhighlight>
 
{{construction}}
 
=== Sending the application to your device ===
You can send the compiled application to your connected device with the following command:
<syntaxhighlight lang="bash">adb install -r marble.apk</syntaxhighlight>

Latest revision as of 04:51, 26 October 2016

This page is now on the community wiki.