How deltachat/deltachat-android works
Main Components
• Android Application (Frontend/UI): Represent the different source variants (e.g., “src/main”, “src/foss”, “src/gplay”) which include Activities, Fragments, Services, Content Providers, and Broadcast Receivers. Note that the UI is built using standard Android components (many layouts, resources, XML files).
• Native/ Core Library Layer: Illustrate the integration with the core messaging engine (deltachat-core-rust). This native component is built via the NDK build scripts and lives partly in the “jni/” folder and also exists as a git submodule. Indicate the JNI bridge and how it communicates with the Java layer.
• Build and Tooling Environment:
– Gradle build files (build.gradle, settings.gradle) for building the Android project.
– Build scripts under “scripts/” that manage tasks such as cross-compilation, toolchain installation, and launching the NDK build (e.g. ndk-make.sh).
– Dockerfile and Nix (flake.nix) support for containerized development environments.
• CI/CD & Metadata/Deployment:
– GitHub Actions workflows (in “.github/workflows”) for artifact generation and APK previews.
– Fastlane directory for managing metadata and publishing to F-Droid, Google Play, etc.
• Internationalization & External Resources:
– Translations managed with Weblate are indirectly integrated via fastlane/metadata and the metadata folder.
– Additional configuration files (e.g., google-services.json) which suggest dependency on external services such as Firebase.
Relationships and Interactions
• Specify the build toolchain: Gradle orchestrates the build process, while integration with NDK scripts and Rust cross-compilation happens through the “scripts/” folder. Show these elements as supporting infrastructure that “builds” the app.
• External integration points for release deployment (fastlane metadata for Play Store and F-Droid) and testing (automated UI tests, Android instrumented tests in “src/androidTest”).
Architectural Patterns and Design Principles
• Modular Design: Show how the submodule (the Delta Chat Core native library) is an independent component (in a separate repository) that is integrated into the Android app.
• Layered Architecture: Represent the application as layered where the top layer is presentation (activities, fragments), the middle layer contains services/utilities (events, networking, database access), and a lower layer handles native operations.
• Testing and CI/CD automation as part of the development lifecycle.