Android client for the Qlarr survey platform — an open-source, offline-first data collection tool. Enumerators install the app, download published surveys, and collect responses anywhere, syncing to the backend whenever connectivity returns.
Qlarr is an open-source survey platform designed for professional data collection with a focus on:
- Offline-First Design: Collect data anywhere without internet connectivity
- Advanced Survey Logic: Customize surveys with predictable and traceable state machine logic
- Open-Source Freedom: Complete control and uncompromised privacy
- Cross-Platform Portability: Seamlessly move surveys across platforms and devices
- GDPR Compliance: Full data privacy and compliance with GDPR standards
The Android app is one piece of a larger, survey-as-code ecosystem. Surveys are defined as JSON for structure and JavaScript for logic, then executed consistently across web, Android, and iOS from a single definition by a shared engine.
- frontend — React WYSIWYG survey editor and web renderer
- backend — Spring Boot/Kotlin API for survey management, response sync, and GraalVM-powered logic evaluation
- survey-engine-kmp — Kotlin Multiplatform survey engine (shared navigation and domain logic)
- survey-engine-script — survey definition and scripting
- android — this repository: the offline-capable mobile data collection client
- Offline data collection with automatic background synchronization
- A wide range of question types
- Skip logic and relevance conditions
- Randomization and weighted sampling
- Built-in input validation
- Multilingual surveys and answer piping
- Customizable themes and branding
- AI-compatible JSON format for survey storage
- Language: Kotlin 2.2.21, targeting JVM 17
- UI: Jetpack Compose with Material 3 (Activities host Compose screens at navigation boundaries)
- Dependency Injection: Koin (feature-scoped modules)
- Networking: Retrofit 3 + Jackson, with automatic JWT refresh on
401 - Persistence: Room 2.7 (offline-first local store)
- Background Sync: WorkManager with network constraints and exponential backoff
- Images: Coil
- Survey Engine: survey-engine-kmp
- Survey Rendering: the React frontend is bundled as assets and rendered inside a custom
QlarrWebView, which bridges to native code via a JavaScript interface
The app follows Clean Architecture with three layers:
- Presentation (
ui/) — MVVM with ViewModels and Compose. Key flow:LaunchActivity → LoginActivity → SurveyListActivity → SurveyActivity. - Business (
business/) — use cases and repositories: session/token management, survey fetching, and the response sync pipeline. - Data (
api/,db/,storage/) — Retrofit for the REST API, Room for local persistence, and file storage for uploads.
Data flows offline-first: responses are stored locally first, then a WorkManager upload worker syncs
them to the backend once the device is online. Surveys themselves are rendered by the bundled React
app inside QlarrWebView, which communicates with native navigation via a JavaScript bridge.
- Android Studio (current stable release)
- Android SDK 24 (Android 7.0 Nougat) or higher
- JDK 17
- Gradle is provided via the included wrapper (
./gradlew) - Node.js / npm and git — required to fetch and build the bundled React survey renderer (see below)
- Clone the repository:
git clone https://github.com/qlarr-surveys/android.git
cd android- Fetch the React survey renderer (required — these assets are not committed to the repo, and surveys will not render without them):
./update_react_files.sh-
Open the project in Android Studio
-
Sync Gradle dependencies
-
Build and run the application:
./gradlew assembleDebug
./gradlew installDebugYou can collect against the hosted Qlarr Console or a self-hosted server.
Using the hosted Console:
- Sign up at the Qlarr Console (also serves as a live demo)
- Create a new survey, then publish it from settings
- Run the Android app. On the Login page, choose Login to Private Server, and use your Console
email credentials with server url
https://api.qlarr.com - Collect responses offline
- Sync data when connectivity is available
Self-hosting (local server in ~30 seconds):
git clone https://github.com/qlarr-surveys/frontend.git && cd frontend/deploy
docker compose -f docker-compose.local.yml up -dThis brings up the full stack — the Qlarr UI at http://localhost:3000 and the backend API at
http://localhost:8080 — with default credentials admin@admin.admin / admin. Use the UI to
create and publish a survey, then point the app's Login to Private Server at the backend API
url to collect against it (from the Android emulator, reach the host machine via
http://10.0.2.2:8080). To stop the stack, run
docker compose -f docker-compose.local.yml down.
See the deployment guide for full details.
The app is designed to work seamlessly in offline environments:
- All survey data is stored locally
- Automatic synchronization when network becomes available
- Conflict resolution for multi-device scenarios
android/
├── app/
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ ├── assets/react-app/ # bundled React survey renderer
│ │ │ ├── res/
│ │ │ └── AndroidManifest.xml
│ │ └── test/
│ └── build.gradle
├── gradle/
└── build.gradle
The bundled React renderer in app/src/main/assets/react-app/ is generated, not edited by hand, and
is not checked into the repository (it is git-ignored). You must run the fetch script after
cloning — and any time you want the latest renderer — before building:
./update_react_files.shThe script clones the frontend repo, runs
npm install, builds the production and debug bundles, and copies them into
app/src/main/assets/react-app/ and app/src/debug/assets/react-app/. It requires git and
Node.js/npm.
To build the release version:
./gradlew assembleReleaseTo run tests:
./gradlew test
./gradlew connectedAndroidTestWe welcome contributions to the Qlarr Android app! Please see our Contributing Guidelines for more information.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Kotlin coding conventions
- Use meaningful variable and function names
- Write unit tests for new features
- Document public APIs
./gradlew test./gradlew connectedAndroidTestThis project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.
The AGPL-3.0 license ensures that:
- You have the freedom to use, modify, and distribute this software
- Any modifications must be released under the same license
- Network use triggers source code disclosure requirements
- The software remains free and open for all users
- frontend - WYSIWYG survey editor and web renderer
- backend - Backend infrastructure
- survey-engine-kmp - Kotlin Multiplatform survey engine
- survey-engine-script - Survey definition scripting
For questions, issues, or feature requests:
- Join the Discord community
- Open an issue on GitHub Issues
- Visit our community forum
- Check the FAQ
Built with modern Android development tools and libraries:
- Kotlin and Coroutines
- Jetpack Compose and Material 3
- Koin for dependency injection
- Retrofit and Jackson for networking
- Room for local data persistence
- WorkManager for background synchronization
Upcoming features and improvements:
- Enhanced offline capabilities
- Additional question types
- Improved data visualization
- Advanced analytics integration
- Multi-language support enhancements
Qlarr - Open Source, Offline-First Survey Platform
For more information, visit qlarr.com