Android: Difference between revisions

From KDE Community Wiki
(Move example to tutorial page.)
(Todos are now at Phabrictor project)
Line 64: Line 64:
=== References: ===
=== References: ===
* [https://mail.kde.org/mailman/listinfo/kde-android KDE Android - Discussion Mailing List]
* [https://mail.kde.org/mailman/listinfo/kde-android KDE Android - Discussion Mailing List]
* [https://phabricator.kde.org/project/profile/45/ Phabricator Project]
* Extra-CMake-Modules Toolchain: [http://api.kde.org/ecm/toolchain/Android.html API documentation]
* Extra-CMake-Modules Toolchain: [http://api.kde.org/ecm/toolchain/Android.html API documentation]


Line 74: Line 75:
* 2015-01 - GCompris Devels: [http://gcompris.net/newsall-en.html#2015-01-06 GCompris is now released on Android]
* 2015-01 - GCompris Devels: [http://gcompris.net/newsall-en.html#2015-01-06 GCompris is now released on Android]
* 2014-06 - Alex Pol: [http://www.proli.net/2014/06/12/kde-software-on-android/ KDE Software on Android]
* 2014-06 - Alex Pol: [http://www.proli.net/2014/06/12/kde-software-on-android/ KDE Software on Android]
== Current TODOS ==
* add ported applications to kdesrc file -> CoLa

Revision as of 10:29, 13 March 2016

KDE Software on Android

Android is currently the mobile platform regarding market share and number of provided applications. Hence, it is a platform very well suited to increase the availability and usage of applications by the KDE community. In the following, we give an overview of the technical steps required to setup a build system for cross-compiling a Qt5/KF5 based Android application, the necessary steps to deploy it, and a reference list of the porting steps by different applications/people.

If you enter the field of cross-compiling and Qt on Android for the first time, the best start is to follow our tutorial:

Build Environment

There are different ways to setup a build environment:

  1. Use Ready-to-Build Docker Container
  2. Setup your Build Environment Manually

Building

Example: Building Marble

cd /opt/android
git clone kde:marble
mkdir marble/build
cd marble/build
cmake -DCMAKE_PREFIX_PATH=${Qt5_android} -DCMAKE_TOOLCHAIN_FILE=/PATH/TO/ECM/toolchain/Android.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../export  ..
make install/strip

Note:

  • /PATH/TO/ECM/toolchain/Android.cmake must be replaced with the actual path to toolchain/Android.cmake, if using the docker image it probably is at /opt/android/kde/install/share/ECM/toolchain/Android.cmake
  • make install/strip strips build symbols from the binaries and reduces sizes considerably

Building with KDESRC-BUILD

For building the below mentioned frameworks on Android, you can use the following kdesrc-buildrc config file:

cd /opt/android
git clone git://anongit.kde.org/scratch/cordlandwehr/kdesrc-conf-android.git
mkdir -p extragear/kdesrc-build
git clone git://anongit.kde.org/kdesrc-build extragear/kdesrc-build
ln -s extragear/kdesrc-build/kdesrc-build kdesrc-build
ln -s kdesrc-conf-android/kdesrc-buildrc kdesrc-buildrc
./kdesrc-build extra-cmake-modules frameworks-android

Packaging and Deployment of APKs

Note

See ECM Toolchain documentation, to be added here as example


Status of KDE Frameworks 5

The following frameworks can currently be used for Qt5/KF5 based applications. They are not (yet?) provided as precompiled libraries but can easily be compiled via kdesrc-build.

Built Successfully

  • kconfig (note: unit tests must be disabled)
  • kcompletion
  • kitemmodels
  • kitemviews
  • kcodecs
  • karchive
  • kguiaddons
  • kwidgetsaddons
  • attica
  • kdnssd
  • kapidox
  • kimageformats
  • kplotting
  • ki18n (libintl-lite is required, since BIONIC does not fully support gettext)

Current Blockers

The following frameworks cannot yet be built and block building of further Tier 1 frameworks:

  • kcoreaddons: unix specific backend not compatible with Android's libc

Further References

References:

Application specific build instructions:

Blog posts about building for Android (careful: instructions may be outdated)