FieldTask5 is an Android data collection application for Monitoring & Evaluation and Case Management in field environments, including locations without data connectivity. It is part of the Smap framework for digitalization projects and is a modernized fork of ODK Collect with custom "smap" functionality.
Key Features:
- Offline data collection with automatic sync when connected
- Task management with geofencing and scheduling
- AWS Cognito integration for device management
- Push notifications via Firebase Cloud Messaging
- Custom form widgets for charts, NFC, and sub-forms
- Multi-organization support with 16 product flavors
- Location tracking with customizable behavior per flavor
Built With:
- Android SDK 21+ (Android 5.0 Lollipop to Android 15)
- Kotlin & Java
- Multi-module Gradle architecture (43 modules)
- Custom JavaRosa library (5.1.4-smap)
Further details on installing and testing FieldTask on an Android device can be found in the Smap documentation. You will need to set up an account on the free hosted server to test the app.
- The Smap Ecosystem
- Setting Up Your Development Environment
- Building the Application
- Running Tests
- Product Flavors
- Custom JavaRosa Dependency
- Issues and Bug Reporting
- Contributing
- Related Repositories
- Acknowledgements
FieldTask5 is designed to work as part of the Smap ecosystem, which provides a complete solution for mobile data collection and case management. The ecosystem consists of multiple interconnected components:
┌─────────────────┐
│ FieldTask5 │ ◄─── Mobile data collection (this repository)
│ (Android App) │
└────────┬────────┘
│ HTTPS/REST API
▼
┌─────────────────┐
│ Smap Server │ ◄─── Backend server, API, data storage
│ (Java) │
└────────┬────────┘
│
┌────┴────┬──────────┬─────────────┐
▼ ▼ ▼ ▼
┌────────┐ ┌────────┐ ┌──────────┐ ┌──────────┐
│WebForm │ │ Smap │ │PostgreSQL│ │ AWS │
│(Client)│ │ Client │ │ Database │ │ Services │
└────────┘ └────────┘ └──────────┘ └──────────┘
| Component | Purpose | Technology |
|---|---|---|
| FieldTask5 | Mobile data collection app (this repository) | Android/Kotlin |
| JavaRosa | Form processing engine with smap extensions | Java |
| Smap Server | Backend API, data storage, user management | Java |
| WebForm | Browser-based form completion | JavaScript |
| Smap Client | Web-based administration and data analysis | JavaScript |
| PostgreSQL | Relational database for data storage | SQL |
| AWS | Device registration, push notifications (optional) | Cloud Services |
- Form Creation: Forms are designed in Smap Client or uploaded as XLSForm
- Form Distribution: Server pushes forms to registered FieldTask devices
- Data Collection: Field workers complete forms offline on FieldTask
- Automatic Sync: When connected, FieldTask auto-uploads completed surveys
- Data Processing: Server validates, stores in PostgreSQL, triggers workflows
- Analysis: Data accessible via Smap Client, APIs, or direct database queries
- Java Development Kit (JDK) 17 or higher
- Android Studio (latest stable version recommended)
- Git for version control
- A Google account for Firebase and Maps API setup
- A Mapbox account for map functionality
git clone https://github.com/smap-consulting/fieldTask5.git
cd fieldTask5The master branch contains the latest stable code.
- Launch Android Studio
- Select "Open" and navigate to the cloned
fieldTask5directory - Android Studio will automatically sync Gradle dependencies
- Wait for indexing to complete
Create a secrets.gradle file in the project root directory based on the example:
cp secrets.gradle.example secrets.gradleEdit secrets.gradle and add your API keys:
ext {
MAPBOX_ACCESS_TOKEN = "pk.eyJ1..." // Your Mapbox access token
MAPBOX_DOWNLOADS_TOKEN = "sk.ey..." // Your Mapbox downloads token
GOOGLE_MAPS_API_KEY = "AIzaSy..." // Your Google Maps API key
}Getting API Keys:
- Mapbox: Create a free account and get your tokens from the account page
- Google Maps: Enable Maps SDK for Android and create an API key
- Go to the Firebase Console
- Create a new project or use an existing one
- Add an Android app with package name:
org.smap.smapTask.android - Download
google-services.json - Place it in
collect_app/google-services.json
Note: The project includes a placeholder google-services.json that allows builds to succeed, but push notifications won't work without a valid configuration.
In Android Studio:
- Go to Build > Select Build Variant
- For
collect_app, selectstandardDebug
Note. Custom code for many of the variants is not included in GitHub. Hence you are probably best to stick to "standard" or create your own variant using one of the other included variants as the starting point.
Click the green Run button or press Shift+F10 to build and launch in an emulator or connected device.
# Build debug APK for standard flavor
./gradlew assembleStandardDebug
# Build release APK (requires signing configuration)
./gradlew assembleStandardRelease
# Build all variants
./gradlew build
# Clean build artifacts
./gradlew clean
# Install debug APK to connected device
./gradlew installStandardDebugAPK files are generated in:
collect_app/build/outputs/apk/{flavor}/{buildType}/
For example:
collect_app/build/outputs/apk/standard/debug/collect_app-standard-debug.apk
FieldTask5 has comprehensive test coverage with 2000+ unit and instrumentation tests.
./gradlew test./gradlew testStandardDebugUnitTest# Run all instrumented tests
./gradlew connectedStandardDebugAndroidTest
# Run specific test class
./gradlew connectedAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=org.odk.collect.android.YourTest# Run all quality checks (PMD, ktlint, Checkstyle, Lint)
./gradlew checkCode
# Auto-format Kotlin code
./gradlew ktlintFormatAfter running tests, view HTML reports at:
- Unit tests:
{module}/build/reports/tests/testDebugUnitTest/index.html - Instrumented tests:
{module}/build/reports/androidTests/connected/index.html
Each flavor can customize:
- Icons and branding (
src/{flavor}/res/) - Location behavior (
LocationRegister.javain flavor directory) - AndroidManifest settings
- Strings and resources
# Build fieldTaskMax debug
./gradlew assembleFieldTaskMaxDebug
# Run tests for fieldTaskMax flavor
./gradlew testFieldTaskMaxDebugUnitTestFieldTask5 uses a custom version of JavaRosa (5.1.4-smap) with smap-specific enhancements. The built artifact is checked into version control in the .local-m2/ directory, so you don't need to build JavaRosa separately for normal development.
The custom JavaRosa is already included in the repository:
.local-m2/org/getodk/javarosa/5.1.4-smap/
├── javarosa-5.1.4-smap.jar (681KB)
├── javarosa-5.1.4-smap.module
└── javarosa-5.1.4-smap.pom
Just clone and build - it works out of the box! 🎉
If you need to make changes to JavaRosa:
- Clone the smap JavaRosa repository
- Make your changes in the JavaRosa codebase
- Build and publish to your local Maven repository:
cd /path/to/javarosa ./gradlew publishToMavenLocal - Gradle automatically uses your
~/.m2/repository/version (higher priority than.local-m2/) - When stable, copy the updated artifacts back:
cd /path/to/fieldTask5 cp ~/.m2/repository/org/getodk/javarosa/5.1.4-smap/* \ .local-m2/org/getodk/javarosa/5.1.4-smap/ git add .local-m2/ git commit -m "Update custom javarosa"
We use GitHub Issues to track bugs, feature requests, and development tasks.
For FieldTask5 mobile app issues:
- Use the FieldTask5 Issues page
- Examples: app crashes, UI bugs, form rendering issues, offline sync problems
For server, web clients, or web forms:
- Use the Smap Server Issues page
- Examples: server API issues, web form problems, data processing bugs
When reporting a bug, please include:
- Clear title: Brief description of the issue
- Environment:
- FieldTask version (from About screen)
- Android version and device model
- Server version (if relevant)
- Steps to reproduce:
1. Open the app 2. Navigate to Forms > Get Blank Form 3. Select form "Example Survey" 4. App crashes - Expected behavior: What should happen
- Actual behavior: What actually happens
- Screenshots/logs: If applicable
- Form definition: Attach XLSForm or XML if form-specific
For feature requests:
- Use the FieldTask5 Issues page
- Use label:
enhancement - Describe the use case and expected behavior
- Explain why the feature would be valuable
Common labels used in this repository:
bug- Something isn't workingenhancement- New feature or requestdocumentation- Documentation improvementsgood first issue- Good for newcomershelp wanted- Extra attention neededpriority: high- Urgent issuessmap-specific- Smap customizations (not in upstream ODK)
Contributions are welcome! Please follow these guidelines:
- Fork the repository on GitHub
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes following the code style guidelines
- Write tests for new functionality
- Run quality checks:
./gradlew checkCode - Commit with clear messages:
git commit -m "Add feature: description" - Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request with a clear description
- Language: Write all new code in Kotlin (existing Java is acceptable)
- Formatting: Run
./gradlew ktlintFormatbefore committing - Architecture: Follow MVVM pattern with ViewModels and LiveData
- Testing: Include unit tests for business logic, UI tests for user flows
Follow conventional commit format:
<type>: <description>
<optional body>
<optional footer>
Types: feat, fix, docs, style, refactor, test, chore
Example:
feat: add geofencing support for task notifications
Implements geofencing to trigger push notifications when users
enter or exit task location boundaries.
Closes #123
The complete Smap ecosystem includes multiple repositories:
| Name | GitHub Repository | Purpose |
|---|---|---|
| FieldTask5 | https://github.com/smap-consulting/fieldTask5 | Mobile data collection app |
| JavaRosa | https://github.com/smap-consulting/javarosa | Form processing engine |
| SmapServer2 | https://github.com/smap-consulting/smapserver2 | Backend server & API |
| WebForm | https://github.com/nap2000/webform | Browser-based form client |
| SmapClient | https://github.com/nap2000/prop-smapserver | Administrative web client |
| Documentation | https://github.com/nap2000/docs | User documentation |
| Tests | https://github.com/smap-consulting/prerelease-tests | Pre-release tests |
- Documentation: https://www.smap.com.au/docs/
- Server Downloads: https://www.smap.com.au/docs/server-admin-versions.html
- Getting Started Guide: https://www.smap.com.au/docs/getting-started.html
- FieldTask Documentation: https://www.smap.com.au/docs/fieldTask.html
This project:
- Is a fork of ODK Collect by Open Data Kit
- Includes the Android SDK from Mapbox
- Uses Google Maps Platform for mapping
- Integrates Firebase for push notifications
- Built with Gradle and Android Jetpack
Special thanks to the ODK community for creating and maintaining the excellent ODK Collect codebase that serves as the foundation for FieldTask5.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Questions? Open an issue or contact the Smap team at https://www.smap.com.au