An Android application that collects sensor data from phones and tablets and streams it to a remote OpenSensorHub (OSH) server using OGC standards (SOS-T and Connected Systems API).
On-Device:
- GPS location
- IMU (accelerometers, gyroscopes, magnetometers)
- Fused orientation (quaternions or Euler angles)
- Video camera (H.264, H.265, VP8, VP9, MJPEG)
- Audio microphone (AAC, OPUS)
External (USB / Bluetooth / BLE):
- FLIR One thermal camera (USB)
- Trupulse 360 range finder (Bluetooth)
- Angel Sensor wrist band (BLE)
- Kestrel weather meter (BLE)
- Polar H9/H10 heart rate monitor (Bluetooth)
- Meshtastic mesh radio (Bluetooth)
- STE radiation pager
- BLE beacons
- Android device running Android 14 (API 34) or later
- JDK 17
- Android SDK with Build Tools 30.0.2 and API level 33 installed
- Android Studio (recommended) or Gradle 7.4+ for command-line builds
- Git (with submodule support)
git clone --recursive https://github.com/botts-innovative-research/osh-android.git
cd osh-androidIf you already cloned without --recursive, initialize the submodules separately:
git submodule update --init --recursiveThis pulls in two required submodule dependencies:
- osh-core -- the core OpenSensorHub framework
- osh-addons -- additional sensor drivers and processing modules
Create or verify the local.properties file in the project root:
sdk.dir=/path/to/your/Android/sdkOn macOS this is typically ~/Library/Android/sdk. On Linux it is often ~/Android/Sdk.
- Open Android Studio
- File > Open and select the
osh-androidproject directory - Wait for Gradle sync to complete
- Build > Build Bundle(s) / APK(s) > Build APK(s)
- The APK is output to
sensorhub-android-app/build/outputs/apk/debug/
./gradlew build -x test -x javadoc -x lintDebugThe APK is output to sensorhub-android-app/build/outputs/apk/debug/.
Connect an Android device via USB with USB debugging enabled (Settings > Developer Options > USB Debugging), then run:
./gradlew installDebugOr from Android Studio, click Run > Run 'app' with the device selected.
- Tap the three-dot menu in the app
- Select Settings > General
- Enter the server connection details:
- IP Address and Port
- User and Password (if required)
- Enable at least one service:
- ConSysApi Service (Connected Systems API)
- SOS Service (SOS-T protocol)
- Select a client type:
- Connected Systems Client or SOS-T Client
- From the Settings screen, tap the Sensors tab
- Toggle on the sensors you want to stream (GPS, IMU, Orientation, Video, Audio, etc.)
- For each enabled sensor, tap its options to configure Push Remote if you want data sent to the server
- In Sensors, enable Video Data and turn on Push Remote in its options
- Go to Video Settings and configure:
- Video Codec (e.g., JPEG, H.264)
- Frame Rate (e.g., 30 FPS)
- Selected Camera (0 = back, 1 = front)
- Set up a video preset (Presets 1--5):
- Frame Size (e.g., 1920x1080)
- Min / Max BitRate (e.g., 3000 kbps)
- Assign the preset under Selected Preset
- In Sensors, enable the audio sensor and turn on Push Remote
- Go to Audio Settings and configure:
- Audio Codec (e.g., AAC, OPUS)
- Sample Rate (e.g., 8000)
- BitRate (64 kbps)
- Return to the main screen
- Tap the three-dot menu
- Select Start SmartHub
The app will register with the OSH server and begin streaming data from all enabled sensors.
The app sends data to an OSH server. You can use the osh-node-dev-template to get started.
To accept data from the Android app, setup the correct services on the server:
- Open the admin interface at
http://<server-ip>:<port>/sensorhub/admin - Go to the Services tab
- Select Connected Systems API Service
- Click Lookup Module to add a Database ID
- Select the Database from the list
- Click Apply Changes
- Optionally click Save to persist the configuration across restarts
For full server documentation, see the OSH Node Android docs.
osh-android/
sensorhub-android-app/ # Main demo application (APK)
sensorhub-android-service/ # Background SensorHub service library
sensorhub-android-lib/ # Dependency aggregation library
sensorhub-driver-android/ # Core Android sensor & camera driver
sensorhub-android-polar/ # Polar heart rate monitor driver
sensorhub-android-meshtastic/# Meshtastic mesh radio driver
sensorhub-android-ste/ # STE radiation pager driver
sensorhub-android-flirone/ # FLIR One thermal camera driver
sensorhub-android-blebeacon/ # BLE beacon detector driver
submodules/
osh-core/ # Core OSH framework
osh-addons/ # Additional drivers & processing
- Gradle sync fails: Verify that submodules are initialized (
git submodule update --init --recursive) and thatlocal.propertiespoints to a valid Android SDK. - Build errors with JDK: Ensure JDK 17 is installed and selected in Android Studio (File > Settings > Build > Gradle > Gradle JDK).
- App crashes on launch: Confirm the device runs Android 14 (API 34) or later.
- No data reaching server: Check that the server IP/port are correct, and the device has network connectivity.
- Bluetooth sensors not connecting: Pair the external sensor in Android system Bluetooth settings before enabling it in the app.