{"id":20970451,"url":"https://github.com/crossgeeks/devicesensorsplugin","last_synced_at":"2025-05-14T11:33:15.709Z","repository":{"id":87069325,"uuid":"122435968","full_name":"CrossGeeks/DeviceSensorsPlugin","owner":"CrossGeeks","description":"Device Sensors Notification Plugin for Xamarin, Tizen and Windows","archived":false,"fork":false,"pushed_at":"2018-07-11T01:39:48.000Z","size":30,"stargazers_count":12,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-13T05:29:14.846Z","etag":null,"topics":["accelerometer","android","barometer","device","gyroscope","ios","magnetometer","pedometer","plugin","sensors","tizen","uwp","xamarin"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrossGeeks.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":"2018-02-22T05:42:54.000Z","updated_at":"2025-01-29T16:22:34.000Z","dependencies_parsed_at":"2023-06-09T00:45:10.010Z","dependency_job_id":null,"html_url":"https://github.com/CrossGeeks/DeviceSensorsPlugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrossGeeks%2FDeviceSensorsPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrossGeeks%2FDeviceSensorsPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrossGeeks%2FDeviceSensorsPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrossGeeks%2FDeviceSensorsPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrossGeeks","download_url":"https://codeload.github.com/CrossGeeks/DeviceSensorsPlugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254131794,"owners_count":22020013,"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":["accelerometer","android","barometer","device","gyroscope","ios","magnetometer","pedometer","plugin","sensors","tizen","uwp","xamarin"],"created_at":"2024-11-19T03:58:30.560Z","updated_at":"2025-05-14T11:33:15.294Z","avatar_url":"https://github.com/CrossGeeks.png","language":"C#","readme":"## DeviceSensors Plugin for Xamarin iOS, Android, UWP and Tizen\nSimple cross platform plugin to access device sensors.\n\n## Features\n\n- Access to accelerometer\n- Access to gyroscope\n- Access to magnetometer\n- Access to barometer\n- Access to pedometer\n\n### Setup\n* Available on NuGet: http://www.nuget.org/packages/Plugin.DeviceSensors [![NuGet](https://img.shields.io/nuget/v/Plugin.DeviceSensors.svg?label=NuGet)](https://www.nuget.org/packages/Plugin.DeviceSensors/)\n* Install into your PCL project and Client projects.\n\n\n**Platform Support**\n\n|Platform|Version|\n| ------------------- | :------------------: |\n|Xamarin.iOS|iOS 7+|\n|Xamarin.Android|API 13+|\n|Windows 10 UWP|10+|\n|Tizen|4.0+|\n\n### API Usage\n\nCall **CrossDeviceSensors.Current** from any project or PCL to gain access to APIs.\n\n#### iOS Setup\n\nAdd to your Info.plist **NSMotionUsageDescription** key:\n\n```xml\n\u003ckey\u003eNSMotionUsageDescription\u003c/key\u003e\n\u003cstring\u003eThis app needs to be able to access your motion use\u003c/string\u003e\n```\n\n#### Getting Started\n\nDevice Sensor interface\n\n```cs\npublic interface IDeviceSensor\u003cT\u003e\n    {\n        /// \u003csummary\u003e\n        /// Check if sensor supported\n        /// \u003c/summary\u003e\n        bool IsSupported { get; }\n        /// \u003csummary\u003e\n        /// Check if sensor is active\n        /// \u003c/summary\u003e\n        bool IsActive { get; }\n        /// \u003csummary\u003e\n        /// Get latest sensor reading\n        /// \u003c/summary\u003e\n        T LastReading {get;}\n        /// \u003csummary\u003e\n        /// Sets/get sensor report interval\n        /// \u003c/summary\u003e\n        int ReadingInterval { get; set; }\n        /// \u003csummary\u003e\n        /// Starts sensor reading\n        /// \u003c/summary\u003e\n        void StartReading(int readingInterval = -1);\n        /// \u003csummary\u003e\n        /// Stops sensor reading\n        /// \u003c/summary\u003e\n        void StopReading();\n\n        /// \u003csummary\u003e\n        /// Sensor reading changes event\n        /// \u003c/summary\u003e\n        event EventHandler\u003cDeviceSensorReadingEventArgs\u003cT\u003e\u003e OnReadingChanged;\n    }\n```\n\nAvailable sensors\n\n```cs\n    public interface IDeviceSensors\n    {\n       IDeviceSensor\u003cVectorReading\u003e Accelerometer {get; }\n       IDeviceSensor\u003cVectorReading\u003e Gyroscope { get; }\n       IDeviceSensor\u003cVectorReading\u003e Magnetometer { get; }\n       IDeviceSensor\u003cdouble\u003e Barometer { get; }\n       IDeviceSensor\u003cint\u003e Pedometer { get; }\n    }\n```\nUsage sample:\n\nAccelerometer\n```csharp\n    if(CrossDeviceSensors.Current.Accelerometer.IsSupported)\n    {\n         CrossDeviceSensors.Current.Accelerometer.OnReadingChanged += (s,a)=\u003e{\n\n         };\n         CrossDeviceSensors.Current.Accelerometer.StartReading();\n    }\n   \n\n```\n\n\nGyroscope\n```csharp\n    if(CrossDeviceSensors.Current.Gyroscope.IsSupported)\n    {\n         CrossDeviceSensors.Current.Gyroscope.OnReadingChanged += (s,a)=\u003e{\n\n         };\n         CrossDeviceSensors.Current.Gyroscope.StartReading();\n    }\n   \n\n```\n\nMagnetometer\n```csharp\n    if(CrossDeviceSensors.Current.Magnetometer.IsSupported)\n    {\n         CrossDeviceSensors.Current.Magnetometer.OnReadingChanged += (s,a)=\u003e{\n\n         };\n         CrossDeviceSensors.Current.Magnetometer.StartReading();\n    }\n   \n\n```\n\n\n#### Contributors\n\n* [Rendy Del Rosario](https://github.com/rdelrosario)\n* [Jong Heon Choi](https://github.com/JongHeonChoi)\n* [Dimitri Jevic](https://github.com/dimitrijevic)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrossgeeks%2Fdevicesensorsplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrossgeeks%2Fdevicesensorsplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrossgeeks%2Fdevicesensorsplugin/lists"}