A sophisticated GPS/GLONASS location tracking Android application built with Kotlin Multiplatform and Jetpack Compose.
- Kotlin Multiplatform project structure
- Android app with Jetpack Compose UI
- Shared common code for business logic
- Location data models and services
- Modern Material Design 3 UI
- Automated CI/CD with GitHub Actions
- Semantic versioning and automated releases
- Build logging and artifact management
geo-spider-app/
├── shared/ # Shared Kotlin Multiplatform module
│ ├── src/
│ │ ├── commonMain/ # Common business logic, data models, interfaces
│ │ └── androidMain/ # Android-specific implementations
│ └── build.gradle.kts
├── androidApp/ # Android application module
│ ├── src/main/ # Android app code (Compose UI)
│ └── build.gradle.kts
bin/ # Build and utility scripts
│ ├── build-apk.sh # Main build script
│ └── monitor-workflow.sh # GitHub Actions monitoring
var/logs/ # Build logs (gitignored)
docs/ # Documentation
.github/workflows/ # CI/CD workflows
- GPS/GLONASS location tracking
- Background location service
- Offline data accumulation
- Automatic synchronization
- Configurable intervals
- Jetpack Compose
- Material Design 3
- Dark theme support
- Real-time status updates
- Docker: 20.10+ (for containerized builds)
- Docker Compose: 2.0+ (optional, for local development)
- Android Studio: Hedgehog (2023.1.1) or later
- JDK: 21 (LTS, recommended) or 17+
- Android SDK: API level 21+ (Android 5.0+)
- Gradle: 8.10.2+ (included via wrapper)
Use Docker for consistent, reproducible builds:
./bin/build-docker.shThis script uses the budtmo/docker-android Docker image which contains:
- Android SDK with command-line tools
- Gradle 8.10.2
- Android SDK platforms and build tools
- All necessary dependencies
The script will:
- Pull the pre-built Docker image (cached after first use)
- Accept Android SDK licenses automatically
- Install additional SDK components if needed (API 35, build-tools 35.0.0)
- Build the release APK inside the container
- Save build logs to
var/logs/ - Copy APK to
build-outputs/directory - Display APK information
Benefits of Docker builds:
- Consistent build environment across all machines
- No need to install Android SDK locally
- Isolated build environment
- Faster CI/CD pipelines (uses pre-built image)
- Well-maintained and actively updated Docker image (13.9k+ stars)
Use the build script which handles prerequisites, logging, and versioning:
./bin/build-apk.shThe script will:
- Check prerequisites (Java, Gradle, Android SDK)
- Accept Android SDK licenses
- Clean previous builds
- Build the release APK
- Save build logs to
var/logs/ - Display APK information
The APK will be generated at:
geo-spider-app/androidApp/build/outputs/apk/release/androidApp-release-unsigned.apk
./gradlew :androidApp:assembleRelease./gradlew :androidApp:assembleDebug./gradlew :androidApp:installDebugFor interactive development with Docker:
# Start container
docker-compose up -d
# Execute commands inside container
docker-compose exec android-builder ./gradlew :androidApp:assembleRelease
# Stop container
docker-compose downThe project uses Semantic Versioning (MAJOR.MINOR.PATCH) with automatic version calculation from git tags.
In CI/CD (GitHub Actions):
- The workflow automatically calculates the next version from existing git tags
- Finds the latest tag (e.g.,
v1.0.0) - Increments the patch version (e.g.,
1.0.0→1.0.1) - Uses this version for the Gradle build and GitHub release
- Creates a new tag with the calculated version
Version Priority:
- Build parameters (
-PVERSION_NAME,-PVERSION_CODE) - highest priority - gradle.properties - fallback for local builds
- Default (
1.0.0, code1) - if nothing else is set
For local builds, you can set version in gradle.properties:
VERSION_NAME=1.0.0
VERSION_CODE=1Or pass it directly to Gradle:
./gradlew :androidApp:assembleRelease -PVERSION_NAME="1.0.1" -PVERSION_CODE="2"Automatic (CI/CD):
- No manual updates needed!
- Each successful build to
mainautomatically:- Calculates next version from latest git tag
- Builds APK with that version
- Creates git tag
v{VERSION_NAME} - Creates GitHub release with the version
Manual (Local):
- Update
VERSION_NAMEingradle.propertiesfor local testing - Or use
-Pparameters when building
On successful builds to the main branch:
- Git tag is created:
v{VERSION_NAME} - GitHub release is created with the APK attached
- Build logs are uploaded as artifacts
- Release notes are automatically generated
The project uses GitHub Actions with Docker for automated builds and releases.
Workflow: .github/workflows/build-android-apk.yml
Triggers:
- Push to
mainordevelopbranches - Pull requests to
main - Manual workflow dispatch
What it does:
- Builds Docker image with Android SDK and build tools (cached for faster builds)
- Calculates next version from git tags
- Builds the release APK inside Docker container with calculated version
- Uploads build logs (7 days retention)
- Uploads APK artifact (30 days retention)
- Creates git tag (main branch only)
- Creates GitHub release (main branch only)
Docker-based CI/CD Benefits:
- Consistent build environment across all runs
- Faster builds using pre-built budtmo/docker-android
- Isolated build environment
- Easy to reproduce builds locally
- No need to manage Android SDK versions in CI
- Well-maintained Docker image with regular updates
Monitor workflow status:
./bin/monitor-workflow.shOr manually check:
Build logs are automatically saved to var/logs/ with timestamps:
- Format:
build_YYYYMMDD_HHMMSS.log - Logs are gitignored (not committed)
- Available as artifacts in GitHub Actions
- Go to Releases
- Download the APK from the latest release
- Install on your Android device
Releases are automatically created on successful builds to main:
- Tag format:
v1.0.0(semantic version) - Release includes:
- APK file
- Build logs
- Automatic release notes
- Commit information
To create a release manually:
- Update version in
gradle.properties - Commit and push to
main - GitHub Actions will automatically create the release
For detailed development information, setup instructions, coding guidelines, and troubleshooting, please see CONTRIBUTING.md.
- Fork and clone the repository
- Set up development environment (see CONTRIBUTING.md)
- Build the project:
./bin/build-apk.sh
- Read the guidelines in CONTRIBUTING.md before making changes
We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines on how to contribute to this project, including development setup, coding standards, and pull request process.
Please review our Code of Conduct before contributing.
MIT License - see LICENSE file for details.