This page covers everything needed to set up, build, and operate the CROWDio Android mobile worker.
The Android app lets a smartphone or tablet join the CROWDio worker pool. It executes Python task functions on-device using the Chaquopy Python interpreter embedded in the APK.
| Requirement | Details |
|---|---|
| Android Studio | Recent stable version (AGP 8.x support) |
| Android SDK | Compile target API 36, min SDK API 27 |
| Java toolchain | Java 11 |
| Device/Emulator | Android 8.1+ (API 27+) |
| Network | Device must reach CROWDio Foreman (same network or VPN) |
git clone https://github.com/your-org/CROWDio-Android.git
cd CROWDio-Android
Open the project in Android Studio and let Gradle sync.
=== “Linux / macOS”
bash
./gradlew assembleDebug
=== “Windows PowerShell”
powershell
.\gradlew.bat assembleDebug
Install directly to a connected device:
./gradlew installDebug
Install and open the CROWDio app on your device.
Navigate to Settings and enter:
| Setting | Value |
|---|---|
| Foreman IP | IP address of the machine running the Foreman (e.g. 192.168.1.50) |
| HTTP API Port | 8000 (default) |
| Worker WebSocket Port | 9000 (default) |
| Artifact Transfer Port | 8001 (optional, default when enabled) |
Go to the Tasks tab and tap Start Worker.
The app will:
worker_ready with device capabilities.The Dashboard tab displays real-time information fetched from the Foreman REST API:
While a task is running, the following controls are available from the Tasks tab:
| Control | Action |
|---|---|
| Pause | Signals the Python execution context to pause at the next checkpoint |
| Resume | Resumes a paused execution |
| Kill | Terminates the current task immediately and reports a task_error |
Each app installation generates a persistent worker_id (stored via WorkerIdManager). You can optionally set a custom worker name in Settings for easy identification in the Foreman dashboard.
| Behavior | Details |
|---|---|
| Foreground service | START_STICKY — restarts after process kill |
| Reconnection | Exponential backoff with jitter via ReconnectionManager |
| Task queueing | Tasks received while busy are queued in memory |
| Task timeout | 10 minutes per task by default |
| Heartbeat interval | 30 seconds |
| Oversized results | Automatically uploaded via HTTP; token sent in task_result |
| Memory pressure | Low-memory hooks trigger model and execution cleanup |
!!! warning “Android Battery Saver” Android’s battery optimization may suspend or kill background services. To keep the worker reliable:
1. Go to **Settings → Apps → CROWDio → Battery**.
2. Select **Unrestricted** battery usage.
3. Or whitelist the app in your battery saver exclusions.
The following packages are bundled in the APK via Chaquopy:
| Package | Use Case |
|---|---|
textblob |
NLP / sentiment analysis |
nltk |
Natural language processing |
vaderSentiment |
Lexicon-based sentiment scoring |
numpy |
Numerical computation |
requests |
HTTP client |
aiohttp |
Async HTTP |
Pillow |
Image processing |
tflite-runtime |
TensorFlow Lite model inference |
To add more packages, update the chaquopy block in app/build.gradle.kts.
After starting the worker, verify from the Foreman:
curl http://localhost:8000/api/workers
Look for an entry with "type": "android_kotlin" and "status": "online".