QtAndroidTemplate is a starter project for building cross-platform Qt applications targeting Android and desktop environments. It uses CMake for build configuration and Conan for dependency management, with a focus on modularity and modern C++ practices.
- CMake (minimum version 3.24)
- Conan (for dependency management)
- Qt (for application development)
- fmt library (as an example dependency)
- VS Code Extensions (recommended for development):
- ms-vscode.cpptools
- ms-vscode.cmake-tools
- vadimcn.vscode-lldb
- cheshirekow.cmake-format
- ms-vscode.cpptools-extension-pack
- eamodio.gitlens
- adelphes.android-dev-ext
- github.vscode-github-actions
- josetr.cmake-language-support-vscode
- llvm-vs-code-extensions.vscode-clangd
- theqtcompany.qt-qml
- Delgan.qml-format
Clone the repository and use CMake and Conan to configure and build the project. See the provided CMakeLists.txt and conanfile.txt for example usage and dependencies.
There is a small application called QRLite that does nothing except display a white screen
The devcontainer is available on dockerhub: https://hub.docker.com/repository/docker/bernedom/qtandroidbuilder/general
To build it yourself use docker buildx
cd .devcontainer
docker buildx build -t bernedom/qtandroidbuilder:dev .The project is set up to use CMake for configuring the build system and Conan for managing dependencies. The CMakeLists.txt file includes configurations for both Android and desktop builds, with platform-specific settings and options.
In the devcontainer, the Android SDK and NDK are pre-installed, along with necessary environment variables set for building Android applications. The Conan profile is also configured for cross-compiling to Android. The default profile is detected so the host toolchain using gcc is the default, because if this is not done and the first build is an android build the android toolchain becomes the default. If you want to change it, edit the ~/.conan/profiles/default file inside the container.