{"id":20115528,"url":"https://github.com/mutualmobile/composesensors","last_synced_at":"2025-04-04T07:09:31.426Z","repository":{"id":147241726,"uuid":"618044998","full_name":"mutualmobile/ComposeSensors","owner":"mutualmobile","description":"Access sensor data for any Android device easily using Jetpack Compose 🌡️ 🧲 🧭","archived":false,"fork":false,"pushed_at":"2024-10-16T19:41:12.000Z","size":2017,"stargazers_count":208,"open_issues_count":4,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-18T18:38:35.317Z","etag":null,"topics":["android","android-library","android-libray","android-sensors","jetpack-compose","kotlin","kotlin-android","sensors"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mutualmobile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-23T16:30:39.000Z","updated_at":"2024-10-15T22:12:50.000Z","dependencies_parsed_at":"2023-12-19T14:57:29.759Z","dependency_job_id":"e915393f-233c-499b-a59f-e4b52c456906","html_url":"https://github.com/mutualmobile/ComposeSensors","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2FComposeSensors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2FComposeSensors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2FComposeSensors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2FComposeSensors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mutualmobile","download_url":"https://codeload.github.com/mutualmobile/ComposeSensors/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135147,"owners_count":20889421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","android-libray","android-sensors","jetpack-compose","kotlin","kotlin-android","sensors"],"created_at":"2024-11-13T18:35:33.957Z","updated_at":"2025-04-04T07:09:31.219Z","avatar_url":"https://github.com/mutualmobile.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eCompose Sensors\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"200\" src=\"https://raw.githubusercontent.com/mutualmobile/ComposeSensors/main/art/thumnail.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Kotlin-0095D5?\u0026style=for-the-badge\u0026logo=kotlin\u0026logoColor=white\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Compose-093042?style=for-the-badge\u0026logo=jetpackcompose\u0026logoColor=3DDC84\"\u003e\n    \u003ca href=\"https://oss.sonatype.org/#nexus-search;gav~com.mutualmobile~composesensors~~~\"\u003e\n        \u003cimg src=\"https://img.shields.io/nexus/r/com.mutualmobile/composesensors?server=https%3A%2F%2Foss.sonatype.org\u0026style=for-the-badge\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://androidweekly.net/issues/issue-575\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/575-brightgreen?style=for-the-badge\u0026label=Android%20Weekly\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nAccessing sensor data of your Android devices just became quick and easy ⚡️\n\nThis library provides a convenience wrapper over the [Sensor APIs](https://developer.android.com/guide/topics/sensors/sensors_overview) for Android to be used with Jetpack Compose.\n\n## Demo ❤️\nBecause `A picture is worth a thousand words`\n\n![Screen Recording 2023-04-03 at 1 00 08 PM](https://user-images.githubusercontent.com/89389061/229441943-6339d18f-c704-4d92-9fe8-28c2fd94fdeb.gif)\n\n## Usage 🚀\n### Install dependency 📲\n#### Kotlin `build.gradle.kts (:module-name)`\n```\ndependencies {\n    ...\n    implementation(\"com.mutualmobile:composesensors:x.y.z\")\n}\n```\n#### Groovy `build.gradle (:module-name)`\n```\ndependencies {\n    ...\n    implementation 'com.mutualmobile:composesensors:x.y.z'\n}\n```\n\nThe library provides straightforward state methods for multiple sensors like Accelerometer, Gyroscope, etc (more mentioned below). Following is an example on how to get the current values from the `Accelerometer`:\n```\nval accelerometerState = rememberAccelerometerSensorState()\n```\nUse it in an example:\n```\nval accelerometerState = rememberAccelerometerSensorState()\n// Optional: You could also write: rememberAccelerometerSensorState(sensorDelay = SensorDelay.Fastest) for fetching sensor data faster\n\nText(\n    text = \"Force X: ${accelerometerState.xForce}\" +\n    \"\\nForce Y: ${accelerometerState.yForce}\" +\n    \"\\nForce Z: ${accelerometerState.zForce}\" +\n    \"\\nIs Available?: ${accelerometerState.isAvailable}\"\n)\n```\n\n## Sensors Supported 📱\nComposeSensors supports the following Android sensors:\nSensor | Composable\n------------- | -------------\nAccelerometer | `rememberAccelerometerSensorState()`\nMagnetic Field | `rememberMagneticFieldSensorState()`\nGyroscope | `rememberGyroscopeSensorState()`\nLight  | `rememberLightSensorState()`\nPressure | `rememberPressureSensorState()`\nProximity | `rememberProximitySensorState()`\nGravity | `rememberGravitySensorState()`\nLinear Acceleration | `rememberLinearAccelerationSensorState()`\nRotation Vector | `rememberRotationVectorSensorState()`\nRelative Humidity | `rememberRelativeHumiditySensorState()`\nAmbient Temperature | `rememberAmbientTemperatureSensorState()`\nMagnetic Field (Uncalibrated)️ | `rememberUncalibratedMagneticFieldSensorState()`\nGameRotation Vector | `rememberGameRotationVectorSensorState()`\nGyroscope (Uncalibrated) | `rememberUncalibratedGyroscopeSensorState()`\nSignificant Motion| `rememberSignificantMotionSensorState(onMotionEvent = {})`\nStep Detector | `rememberStepDetectorSensorState()`\nStep Counter | `rememberStepCounterSensorState()`\nGeomagnetic Rotation Vector | `rememberGeomagneticRotationVectorSensorState()`\nHeart Rate | `rememberHeartRateSensorState()`\nPose6DOF| `rememberPose6DOFSensorState()`\nStationary Detect | `rememberStationaryDetectSensorState()`\nMotion Detect | `rememberMotionDetectSensorState()`\nHeart Beat| `rememberHeartBeatSensorState()`\nLow Latency Off-Body Detect | `rememberLowLatencyOffBodyDetectSensorState()`\nAccelerometer (Uncalibrated) | `rememberUncalibratedAccelerometerSensorState()`\nHinge Angle | `rememberHingeAngleSensorState()`\nHead Tracker | `rememberHeadTrackerSensorState()`\nAccelerometer Limited Axes | `rememberLimitedAxesAccelerometerSensorState()`\nGyroscope Limited Axes | `rememberLimitedAxesGyroscopeSensorState()`\nAccelerometer Limited Axes (Uncalibrated) | `rememberUncalibratedLimitedAxesAccelerometerSensorState()`\nGyroscope Limited Axes (Uncalibrated) | `rememberUncalibratedLimitedAxesGyroscopeSensorState()`\nHeading | `rememberHeadingSensorState()`\n\n## License 🔖\n```\nCopyright 2023 MutualMobile\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutualmobile%2Fcomposesensors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmutualmobile%2Fcomposesensors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutualmobile%2Fcomposesensors/lists"}