GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - UmerCodez/SensorSpot: Android app to stream real-time device sensor data to an MQTT broker. Select sensors, configure broker settings, and publish easily.

BranchesTags
Open more actions menu

Latest commit

 

History

180 Commits
180 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.idea
.idea
 
 
app
app
 
 
data
data
 
 
fastlane/metadata/android/en-US
fastlane/metadata/android/en-US
 
 
gradle
gradle
 
 
ui
ui
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

GitHub License Jetpack Compose Badge MQTT Android GitHub Release Material 3

Sensor Spot

Android app to stream real-time device sensor data to an MQTT broker. Select sensors, configure broker settings, and publish seamlessly.

⚠️ The App only supports MQTT v5 for now

Usage

  1. Configure your broker settings.
  2. Press Connect to start streaming the selected sensor data in real time.
  3. App allows user to select or deselect sensors while connected, with the published data automatically updating to reflect the new choices.

The data is published to the topic android/sensor in the following JSON format:

{
  "type": "android.sensor.accelerometer",
  "timestamp": 3925657519043709,
  "values": [0.31892395, -0.97802734, 10.049896]
}
image

Explanation

Array Item Description
values[0] Acceleration force along the x-axis (including gravity)
values[1] Acceleration force along the y-axis (including gravity)
values[2] Acceleration force along the z-axis (including gravity)
  • timestamp: The time (in nanoseconds) when the event occurred. See the timestamp.

Note: For more details about other sensors data and what the values array represent, refer to the official Android documentation:

  • Motion sensors
  • Position sensors
  • Environmental sensors

GPS data format

GPS data is sent in following json format

{
  "type": "android.gps",
  "longitude": 155.9011,
  "latitude": 81.4278,
  "altitude": 217.5,
  "bearing": 135.0,
  "accuracy": 5.2,
  "speed": 2.8,
  "time": 1727845963000
}

where:

Field Description
longitude Longitude in degrees.
latitude Latitude in degrees.
altitude The altitude of the location in meters above the WGS84 reference ellipsoid.
bearing Bearing at the time of this location in degrees. Bearing is the horizontal direction of travel and is unrelated to device orientation. The bearing is guaranteed to be in the range [0, 360).
accuracy Estimated horizontal accuracy radius in meters of this location at the 68th percentile confidence level.
speed Speed at the time of this location in meters per second.
time The Unix epoch time of this location fix, in milliseconds since the start of the Unix epoch (00:00:00 January 1, 1970 UTC).

Limitation on Android 14+ devices

Starting with Android 14, background execution restrictions are more strict. When you connect to the broker, the app starts a foreground service to publish sensor data in real time. However, if you leave the app for more than 5 seconds (e.g., switch to another app or close it), the system may stop this foreground service, causing a disconnection from the broker. This occurs even if background activity is allowed for the app.

To avoid this issue, keep the app running in the foreground while connected.

Video Demo

IMAGE ALT TEXT HERE

Projects Using Sensor Spot

  1. A real time mobile sensor data pipeline with visualizations. A demonstration of a complete real-time data pipeline for collecting Android sensor data and visualizing it using modern data engineering tools.https://github.com/4KSHAT0p/Mobile-Sensor-Visualizer

⭐️ Support

Appreciate the project? Here's how you can help:

  1. Star: Give it a star at the top right. It means a lot!
  2. Contribute: Found an issue or have a feature idea? Submit a PR.
  3. Feedback: Have suggestions? Open an issue or start a discussion.

TODOs

  1. Automatic reconnect
  2. Keep alive

About

Android app to stream real-time device sensor data to an MQTT broker. Select sensors, configure broker settings, and publish easily.

Topics

androidandroid-applicationandroid-sensorsinternet-of-thingsiotiot-applicationmqttmqtt-clientmqtt-protocolremote-sensorssensor-datasensor-monitorsensor-streamingsensorssensors-data-collection

Resources

Readme
GPL-3.0 license
Activity

Stars

54 stars

Watchers

2 watching

Forks

7 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.