Nova Flow OS
KDE Developer Platform
KDE Developer Platform
  • KDE Developer Platform
    • Getting started
      • Building KDE software
        • KDE software
        • Where to find the development team
        • Learning more
        • Choose what to work on
        • Source code cross-referencing
        • Installing build dependencies
        • Set up a development environment
        • Building KDE software with kdesrc-build
        • Basic troubleshooting
        • Tips and tricks
        • IDE Configuration
          • Setting up an IDE for KDE development
          • Visual Studio Code
          • Qt Creator
          • Kate
          • KDevelop
          • CLion
          • Sublime Text
        • Building KDE software manually
        • Building KDE software with distrobox and podman
      • Kirigami
        • KDE is ours
        • Setting up and getting started
        • Explaining pages
        • Layouts, ListViews, and Cards
        • Adding actions
        • Adding a dialog
        • Using separate files
        • Next steps
        • Colors and themes in Kirigami
        • Typography
        • Actions based components
        • Page rows and page stacks
        • Scrollable pages and list views
        • Cards
        • Drawers
        • Chips
        • Dialog types
        • Controls and interactive elements
        • Form layouts
        • Inline messages
        • Action toolbars
        • Progress bars and indicators
        • List views
        • Understanding CMakeLists
        • Figuring out main.cpp
        • Connect logic to your QML user interface
        • Connect models to your QML user interface
        • About page
        • Introduction to Kirigami Addons
        • FormCard About pages
        • Form delegates in your settings pages
      • KXmlGui
        • Getting started with KXmlGui
        • Hello World!
        • Creating the main window
        • Using actions
        • Saving and loading
        • Command line interface
      • Python with Kirigami
        • Apps with QML and Python
        • Your first Python + Kirigami application
        • Creating a Python package
        • Creating a Flatpak
      • Common programming mistakes
      • Adding a new KDE project
    • Features
      • Icons
      • Configuration
        • The KConfig Framework
        • Introduction to KConfig
        • Using KConfig XT
        • KDE Frameworks 6 porting guide
        • Settings module (KCM) development
        • KConfigDialog
      • D-Bus
        • What is D-Bus practically useful for?
        • Introduction to D-Bus
        • Accessing D-Bus interfaces
        • Intermediate D-Bus
        • Creating D-Bus interfaces
        • Using custom types with D-Bus
        • D-Bus autostart services
      • Create your own mouse cursor theme
      • Session management
      • Archives
      • Desktop file
      • KAuth
        • Privilege Escalation
        • Using actions in your applications
      • KIdleTime
      • Akonadi: personal information management
        • Debugging Akonadi Resources
        • Using Akonadi in applications
      • Concurrent programming
      • Solid
      • Sonnet
    • Plasma themes and plugins
      • Getting started
      • Plasma Widget tutorial
        • How to create a plasmoid
        • Setup
        • Porting Plasmoids to KF6
        • Testing
        • QML
        • Plasma's QML API
        • Widget Properties
        • Configuration
        • Translations / i18n
        • Examples
        • C++ API
      • KWin Effects
      • Plasma Desktop scripting
        • Javascript Interaction With Plasma Shells
        • Templates
        • Examples
        • API documentation
        • Configuration keys
      • Plasma Style tutorial
        • Creating a Plasma Style quickstart
        • Understanding Plasma Styles
        • SVG elements and Inkscape
        • Background SVG format
        • System and accent colors
        • Theme elements reference
        • Porting themes to Plasma 5
        • Porting themes to Plasma 6
      • Aurorae window decorations
      • KWin scripting tutorial
        • Quick start
        • KWin scripting API
      • Wallpapers
      • Plasma comic
        • Tutorial
        • Testing and debugging
        • Examples
      • Create a custom Window Switcher
      • KRunner C++ Plugin
        • Basic Anatomy of a Runner
        • KRunner metadata format
    • Applications
      • Creating sensor faces
      • Dolphin
        • Creating Dolphin service menus
      • Kate
        • Kate plugin tutorial
      • KMines
        • Making a KMines theme
      • Writing tests
        • Appium automation testing
    • Packaging
      • Android
        • KDE on Android
        • Building applications for Android
        • Packaging and publishing applications for Android
        • Publishing on Google Play
          • Introduction
          • Packaging your app
          • Adding your app to Google Play
          • Publishing your app
          • Releasing new versions of old apps
        • Porting applications to Android
          • Basic porting
          • Making applications run well on Android
          • Metadata
      • Windows
        • Packaging and publishing applications for Windows
        • Publish your app in the Microsoft Store
          • Packaging your app for the Microsoft Store
          • Submitting your app to the Microsoft Store
      • Plasma Mobile
        • KDE on mobile devices
        • Porting a new device to Plasma Mobile
        • KDE Telephony stack
          • General Overview
          • Kernel layer
          • System daemons
            • General overview
            • Developing Telephony functionality
            • ModemManager Telephony functions
          • Session daemons
          • QML declarative plugin layer
          • KDE application layer
        • Execute applications
      • Distributing KDE software as Flatpak
        • Your first Flatpak
        • Extending your package
        • Nightly Flatpaks and Flathub
        • Testing your Flatpak
    • System administration
      • Shell scripting with KDE dialogs
      • Kiosk: Simple configuration management for large deployment
        • Abstract
        • Introduction to Kiosk
        • Kiosk keys
    • Contribute to the documentation
    • About
      • Readme
      • License
        • Creative Commons Attribution-ShareAlike 4.0 International
        • GNU General Public License 3.0 or later
Powered by GitBook
On this page
  • Introduction
  • Packaging the application
  • Signing the APKs
  • Publishing the application on F-Droid
  • Summary
  1. KDE Developer Platform
  2. Packaging
  3. Android

Packaging and publishing applications for Android

Learn how to package and publish your applications for Android

PreviousBuilding applications for AndroidNextPublishing on Google Play

Last updated 8 months ago

Introduction

This tutorial will guide you in packaging an application for Android and publishing it in one of KDE's F-Droid repositories.

We assume that there is already a working blueprint for the application you want to package and publish. If not then read the tutorial on .

We use as example.

Packaging the application

In the first step we configure the CI/CD pipeline of Kongress in KDE's GitLab, so that it creates APKs. We do this by adding the template /gitlab-templates/craft-android-qt6-apks.yml to the .gitlab-ci.yml file of Kongress:

include:
  - project: sysadmin/ci-utilities
    file:
      [...]
      - /gitlab-templates/craft-android-qt6-apks.yml

This template adds four jobs to CI/CD pipeline of Kongress:

  • craft_android_qt66_arm32, craft_android_qt66_arm64, and craft_android_qt66_x86_64 which build APKs for three different processor architectures, and

  • fdroid_apks_qt66 which we will look at a bit later.

When we now run a CI/CD pipeline for Kongress then, after successful completion, the three craft_android_* jobs will have created APKs which we can download by browsing the job artifacts. You'll find the APKs in the folder .kde-ci-packages/.

By default, the APKs are not signed. If you want to install such an APKs on your device then you have to sign it as described in the [previous tutorial]({{< ref "building_applications#signing-apks" >}}).

Note If the application you want to package is based on Qt 5 then include the template `/gitlab-templates/craft-android-apks.yml`.

See the for more information about the available CI/CD job templates.

Signing the APKs

utilities/kongress:
  applicationid: org.kde.kongress
  branches:
    release/24.02:

When we now run a CI/CD pipeline for Kongress on the release/24.02 branch then the three craft_android_* jobs will create signed APKs which you can install on your device without having to sign them yourself.

Note Only mainline branches can be cleared for signing. Mainline branches are the `master` branch and release branches like `release/24.02`. APKs created on work branches and forks are never signed.

Publishing the application on F-Droid

Now that we have signed APKs created for the latest release branch of Kongress we want to publish them in our F-Droid repository to make it easier to install and update Kongress. But before we do this we download the APK, install it on our device and perform a more or less thorough test to ensure that the APK works.

utilities/kongress:
  applicationid: org.kde.kongress
  branches:
    master:
    release/24.02:
      repository: stable-releases

These settings tell the CI/CD system that the APKs built on the master branch shall be published in the default repository (which is the nightly builds repository) and that the APKs built on the release/24.02 branch shall be published in the release builds repository.

Summary

In this tutorial we have learned how to configure KDE's CI/CD system to package an application for Android and how to publish it in one of KDE's F-Droid repositories so that our users can easily install it.

Now we configure our CI/CD system, so that it signs the APKs created by the CI/CD pipeline. The CI/CD system signs APKs on project branches which are cleared for APK signing. We want to sign the APKs created for the 24.02 release branch. Project branches are cleared for APK signing by adding them to the in the ci-utilities repository. To clear the 24.02 release branch of Kongress for APK signing we add the following to apksigner-projects.yaml:

See the documentation of the for details.

After we have verified that the APK works we configure the CI/CD system to publish the APKs created for the 24.02 release branch of Kongress in our . For this we add the following to the :

See the documentation of the for details.

building applications for Android
Kongress
documentation of our CI/CD pipelines
project settings of the apksigner
apksigner's project settings
Android Release Builds F-Droid repository
project settings of the fdroidpublisher
fdroidpublisher's project settings