├── .gitattributes ├── .gitignore ├── ISSUE_TEMPLATE ├── LICENSE.md ├── Plugin.Sensors.sln ├── Plugin.Sensors ├── CardinalDirection.cs ├── CompassAccuracy.cs ├── CompassReading.cs ├── CrossSensors.cs ├── DeviceOrientation.cs ├── Extensions.cs ├── IAccelerometer.cs ├── IAmbientLight.cs ├── IBarometer.cs ├── ICompass.cs ├── IDeviceOrientation.cs ├── IGyroscope.cs ├── IMagnetometer.cs ├── IMotionActivity.cs ├── IMotionSensor.cs ├── IPedometer.cs ├── IProximity.cs ├── ISensor.cs ├── MotionActivityEvent.cs ├── MotionReading.cs ├── Platforms │ ├── Android │ │ ├── AbstractSensor.cs │ │ ├── AccelerometerImpl.cs │ │ ├── AcrSensorManager.cs │ │ ├── AmbientLightImpl.cs │ │ ├── BarometerImpl.cs │ │ ├── CompassImpl.cs │ │ ├── CrossSensors.cs │ │ ├── DeviceOrientationImpl.cs │ │ ├── GyroscopeImpl.cs │ │ ├── MagnetometerImpl.cs │ │ ├── MotionActivityImpl.cs │ │ ├── PedometerImpl.cs │ │ └── ProximityImpl.cs │ ├── Tizen │ │ ├── AccelerometerImpl.cs │ │ ├── AmbientLightImpl.cs │ │ ├── CrossSensors.cs │ │ ├── DeviceOrientationImpl.cs │ │ ├── GyroscopeImpl.cs │ │ └── MagnetometerImpl.cs │ ├── Uwp │ │ ├── AccelerometerImpl.cs │ │ ├── AmbientLightImpl.cs │ │ ├── BarometerImpl.cs │ │ ├── CompassImpl.cs │ │ ├── CrossSensors.cs │ │ ├── DeviceOrientationImpl.cs │ │ ├── GyroscopeImpl.cs │ │ ├── MagnetometerImpl.cs │ │ ├── MotionActivityImpl.cs │ │ ├── PedometerImpl.cs │ │ ├── Plugin.Sensors.rd.xml │ │ └── ProximityImpl.cs │ └── iOS │ │ ├── AbstractMotionSensor.cs │ │ ├── AccelerometerImpl.cs │ │ ├── AmbientLightImpl.cs │ │ ├── BarometerImpl.cs │ │ ├── CompassImpl.cs │ │ ├── CrossSensors.cs │ │ ├── DeviceOrientationImpl.cs │ │ ├── GyroscopeImpl.cs │ │ ├── MagnetometerImpl.cs │ │ ├── MotionActivityImpl.cs │ │ ├── PedometerImpl.cs │ │ └── ProximityImpl.cs └── Plugin.Sensors.csproj ├── Sample ├── Sample.Droid │ ├── Assets │ │ └── AboutAssets.txt │ ├── MainActivity.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── AboutResources.txt │ │ ├── Resource.Designer.cs │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-xhdpi │ │ │ └── icon.png │ │ ├── drawable-xxhdpi │ │ │ └── icon.png │ │ ├── drawable │ │ │ └── icon.png │ │ ├── layout │ │ │ ├── Tabbar.axml │ │ │ └── Toolbar.axml │ │ └── values │ │ │ └── styles.xml │ ├── Sample.Droid.csproj │ └── app.config ├── Sample.UWP │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── LockScreenLogo.scale-100.png │ │ ├── LockScreenLogo.scale-125.png │ │ ├── LockScreenLogo.scale-150.png │ │ ├── LockScreenLogo.scale-200.png │ │ ├── LockScreenLogo.scale-400.png │ │ ├── SplashScreen.scale-100.png │ │ ├── SplashScreen.scale-125.png │ │ ├── SplashScreen.scale-150.png │ │ ├── SplashScreen.scale-200.png │ │ ├── SplashScreen.scale-400.png │ │ ├── Square150x150Logo.scale-100.png │ │ ├── Square150x150Logo.scale-125.png │ │ ├── Square150x150Logo.scale-150.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square150x150Logo.scale-400.png │ │ ├── Square44x44Logo.scale-100.png │ │ ├── Square44x44Logo.scale-125.png │ │ ├── Square44x44Logo.scale-150.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.scale-400.png │ │ ├── Square44x44Logo.targetsize-16_altform-unplated.png │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ ├── Square44x44Logo.targetsize-256_altform-unplated.png │ │ ├── Square44x44Logo.targetsize-32_altform-unplated.png │ │ ├── Square44x44Logo.targetsize-48_altform-unplated.png │ │ ├── StoreLogo.png │ │ ├── Wide310x150Logo.scale-100.png │ │ ├── Wide310x150Logo.scale-125.png │ │ ├── Wide310x150Logo.scale-150.png │ │ ├── Wide310x150Logo.scale-200.png │ │ └── Wide310x150Logo.scale-400.png │ ├── FodyWeavers.xml │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ └── Sample.UWP.csproj ├── Sample.iOS │ ├── AppDelegate.cs │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── Default-568h@2x.png │ │ ├── Default-Portrait.png │ │ ├── Default-Portrait@2x.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-Small-40.png │ │ ├── Icon-Small-40@2x.png │ │ ├── Icon-Small-40@3x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ └── LaunchScreen.storyboard │ ├── Sample.iOS.csproj │ ├── iTunesArtwork │ └── iTunesArtwork@2x └── Sample │ ├── App.xaml │ ├── App.xaml.cs │ ├── FodyWeavers.xml │ ├── ISensorViewModel.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── MainViewModel.cs │ ├── Sample.csproj │ └── SensorViewModel.cs ├── changelog.md ├── nuget.exe ├── push.cmd └── readme.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc 262 | Plugin.Sensors.Android/Plugin.Sensors.Android.csproj.bak 263 | Sample/Sample.Droid/Sample.Droid.csproj.bak 264 | /Plugin.Sensors.sln.DotSettings 265 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE: -------------------------------------------------------------------------------- 1 | ## Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported) 2 | 3 | - [] iOS 4 | - [] Android 5 | - [] UWP 6 | - [] .NET Standard 7 | 8 | ## Version of OS(s) listed above with issue 9 | 10 | 11 | ## Version of ACR Sensor Plugin Library 12 | 13 | 14 | ## Expected Behaviour 15 | 16 | 17 | ## Actual Behavior 18 | _If applicable, please include entire exception - type, message, stacktrace_ 19 | 20 | 21 | ## Code of Conduct 22 | * No Library Update Requests 23 | * No Timeline Requests 24 | * Please read through the documentation and FAQs 25 | * Please be respectful of my time. I put a lot of effort into my libraries. I try to support the issue requests within a day. I'm not psychic, so please take the time to fill out the above form as complete as possible -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2017 Allan Ritchie 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Plugin.Sensors.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2010 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plugin.Sensors", "Plugin.Sensors\Plugin.Sensors.csproj", "{150E72BD-08E5-48B6-A7DE-010EC70B4545}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4EFCE66C-F3BB-4924-A6F4-54700188FC67}" 9 | ProjectSection(SolutionItems) = preProject 10 | changelog.md = changelog.md 11 | ISSUE_TEMPLATE = ISSUE_TEMPLATE 12 | LICENSE.md = LICENSE.md 13 | nuget.exe = nuget.exe 14 | push.cmd = push.cmd 15 | readme.md = readme.md 16 | EndProjectSection 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.UWP", "Sample\Sample.UWP\Sample.UWP.csproj", "{D8AD660F-2E4A-4604-A181-C26D6B78AA45}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.iOS", "Sample\Sample.iOS\Sample.iOS.csproj", "{A76015FB-5B2B-40D5-8BDB-50D0E805EE85}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.Droid", "Sample\Sample.Droid\Sample.Droid.csproj", "{23E16784-23E8-4546-A31C-FBCE22ECA17F}" 23 | EndProject 24 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "sample\Sample\Sample.csproj", "{7B815C7C-D030-4441-9982-A23E2101FB9F}" 25 | EndProject 26 | Global 27 | GlobalSection(SharedMSBuildProjectFiles) = preSolution 28 | Plugin.Sensors.Shared\Plugin.Sensors.Shared.projitems*{150e72bd-08e5-48b6-a7de-010ec70b4545}*SharedItemsImports = 4 29 | EndGlobalSection 30 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 31 | Ad-Hoc|Any CPU = Ad-Hoc|Any CPU 32 | Ad-Hoc|ARM = Ad-Hoc|ARM 33 | Ad-Hoc|iPhone = Ad-Hoc|iPhone 34 | Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator 35 | Ad-Hoc|x64 = Ad-Hoc|x64 36 | Ad-Hoc|x86 = Ad-Hoc|x86 37 | AppStore|Any CPU = AppStore|Any CPU 38 | AppStore|ARM = AppStore|ARM 39 | AppStore|iPhone = AppStore|iPhone 40 | AppStore|iPhoneSimulator = AppStore|iPhoneSimulator 41 | AppStore|x64 = AppStore|x64 42 | AppStore|x86 = AppStore|x86 43 | Debug|Any CPU = Debug|Any CPU 44 | Debug|ARM = Debug|ARM 45 | Debug|iPhone = Debug|iPhone 46 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 47 | Debug|x64 = Debug|x64 48 | Debug|x86 = Debug|x86 49 | Release|Any CPU = Release|Any CPU 50 | Release|ARM = Release|ARM 51 | Release|iPhone = Release|iPhone 52 | Release|iPhoneSimulator = Release|iPhoneSimulator 53 | Release|x64 = Release|x64 54 | Release|x86 = Release|x86 55 | EndGlobalSection 56 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 57 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU 58 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU 59 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU 60 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|ARM.Build.0 = Release|Any CPU 61 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU 62 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU 63 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU 64 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU 65 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU 66 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|x64.Build.0 = Release|Any CPU 67 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU 68 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Ad-Hoc|x86.Build.0 = Release|Any CPU 69 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|Any CPU.ActiveCfg = Release|Any CPU 70 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|Any CPU.Build.0 = Release|Any CPU 71 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|ARM.ActiveCfg = Release|Any CPU 72 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|ARM.Build.0 = Release|Any CPU 73 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|iPhone.ActiveCfg = Release|Any CPU 74 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|iPhone.Build.0 = Release|Any CPU 75 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU 76 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU 77 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|x64.ActiveCfg = Release|Any CPU 78 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|x64.Build.0 = Release|Any CPU 79 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|x86.ActiveCfg = Release|Any CPU 80 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.AppStore|x86.Build.0 = Release|Any CPU 81 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 82 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|Any CPU.Build.0 = Debug|Any CPU 83 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|ARM.ActiveCfg = Debug|Any CPU 84 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|ARM.Build.0 = Debug|Any CPU 85 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|iPhone.ActiveCfg = Debug|Any CPU 86 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|iPhone.Build.0 = Debug|Any CPU 87 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 88 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 89 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|x64.ActiveCfg = Debug|Any CPU 90 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|x64.Build.0 = Debug|Any CPU 91 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|x86.ActiveCfg = Debug|Any CPU 92 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Debug|x86.Build.0 = Debug|Any CPU 93 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|Any CPU.ActiveCfg = Release|Any CPU 94 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|Any CPU.Build.0 = Release|Any CPU 95 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|ARM.ActiveCfg = Release|Any CPU 96 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|ARM.Build.0 = Release|Any CPU 97 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|iPhone.ActiveCfg = Release|Any CPU 98 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|iPhone.Build.0 = Release|Any CPU 99 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 100 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 101 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|x64.ActiveCfg = Release|Any CPU 102 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|x64.Build.0 = Release|Any CPU 103 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|x86.ActiveCfg = Release|Any CPU 104 | {150E72BD-08E5-48B6-A7DE-010EC70B4545}.Release|x86.Build.0 = Release|Any CPU 105 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|Any CPU.ActiveCfg = Release|x86 106 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|Any CPU.Build.0 = Release|x86 107 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|Any CPU.Deploy.0 = Release|x86 108 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|ARM.ActiveCfg = Release|ARM 109 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|ARM.Build.0 = Release|ARM 110 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|ARM.Deploy.0 = Release|ARM 111 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|iPhone.ActiveCfg = Release|x86 112 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|iPhone.Build.0 = Release|x86 113 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|iPhone.Deploy.0 = Release|x86 114 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|x86 115 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|x86 116 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|x86 117 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|x64.ActiveCfg = Release|x64 118 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|x64.Build.0 = Release|x64 119 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|x64.Deploy.0 = Release|x64 120 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|x86.ActiveCfg = Release|x86 121 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|x86.Build.0 = Release|x86 122 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Ad-Hoc|x86.Deploy.0 = Release|x86 123 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|Any CPU.ActiveCfg = Release|x86 124 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|Any CPU.Build.0 = Release|x86 125 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|Any CPU.Deploy.0 = Release|x86 126 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|ARM.ActiveCfg = Release|ARM 127 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|ARM.Build.0 = Release|ARM 128 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|ARM.Deploy.0 = Release|ARM 129 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|iPhone.ActiveCfg = Release|x86 130 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|iPhone.Build.0 = Release|x86 131 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|iPhone.Deploy.0 = Release|x86 132 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|iPhoneSimulator.ActiveCfg = Release|x86 133 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|iPhoneSimulator.Build.0 = Release|x86 134 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|iPhoneSimulator.Deploy.0 = Release|x86 135 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|x64.ActiveCfg = Release|x64 136 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|x64.Build.0 = Release|x64 137 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|x64.Deploy.0 = Release|x64 138 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|x86.ActiveCfg = Release|x86 139 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|x86.Build.0 = Release|x86 140 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.AppStore|x86.Deploy.0 = Release|x86 141 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|Any CPU.ActiveCfg = Debug|x86 142 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|Any CPU.Build.0 = Debug|x86 143 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|Any CPU.Deploy.0 = Debug|x86 144 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|ARM.ActiveCfg = Debug|ARM 145 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|ARM.Build.0 = Debug|ARM 146 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|ARM.Deploy.0 = Debug|ARM 147 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|iPhone.ActiveCfg = Debug|x86 148 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86 149 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|x64.ActiveCfg = Debug|x64 150 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|x64.Build.0 = Debug|x64 151 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|x64.Deploy.0 = Debug|x64 152 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|x86.ActiveCfg = Debug|x86 153 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|x86.Build.0 = Debug|x86 154 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Debug|x86.Deploy.0 = Debug|x86 155 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|Any CPU.ActiveCfg = Release|x86 156 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|ARM.ActiveCfg = Release|ARM 157 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|ARM.Build.0 = Release|ARM 158 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|ARM.Deploy.0 = Release|ARM 159 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|iPhone.ActiveCfg = Release|x86 160 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|iPhoneSimulator.ActiveCfg = Release|x86 161 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|x64.ActiveCfg = Release|x64 162 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|x64.Build.0 = Release|x64 163 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|x64.Deploy.0 = Release|x64 164 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|x86.ActiveCfg = Release|x86 165 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|x86.Build.0 = Release|x86 166 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45}.Release|x86.Deploy.0 = Release|x86 167 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone 168 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone 169 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone 170 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone 171 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator 172 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator 173 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Ad-Hoc|x64.ActiveCfg = Ad-Hoc|iPhone 174 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone 175 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone 176 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.AppStore|ARM.ActiveCfg = AppStore|iPhone 177 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.AppStore|iPhone.ActiveCfg = AppStore|iPhone 178 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.AppStore|iPhone.Build.0 = AppStore|iPhone 179 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator 180 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator 181 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.AppStore|x64.ActiveCfg = AppStore|iPhone 182 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.AppStore|x86.ActiveCfg = AppStore|iPhone 183 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Debug|Any CPU.ActiveCfg = Debug|iPhone 184 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Debug|Any CPU.Build.0 = Debug|iPhone 185 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Debug|ARM.ActiveCfg = Debug|iPhone 186 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Debug|iPhone.ActiveCfg = Debug|iPhone 187 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Debug|iPhone.Build.0 = Debug|iPhone 188 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 189 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 190 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Debug|x64.ActiveCfg = Debug|iPhone 191 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Debug|x86.ActiveCfg = Debug|iPhone 192 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Release|Any CPU.ActiveCfg = Release|iPhone 193 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Release|ARM.ActiveCfg = Release|iPhone 194 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Release|iPhone.ActiveCfg = Release|iPhone 195 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Release|iPhone.Build.0 = Release|iPhone 196 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 197 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 198 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Release|x64.ActiveCfg = Release|iPhone 199 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85}.Release|x86.ActiveCfg = Release|iPhone 200 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU 201 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU 202 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU 203 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU 204 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|ARM.Build.0 = Release|Any CPU 205 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|ARM.Deploy.0 = Release|Any CPU 206 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU 207 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU 208 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|iPhone.Deploy.0 = Release|Any CPU 209 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU 210 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU 211 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU 212 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU 213 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|x64.Build.0 = Release|Any CPU 214 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|x64.Deploy.0 = Release|Any CPU 215 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU 216 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|x86.Build.0 = Release|Any CPU 217 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Ad-Hoc|x86.Deploy.0 = Release|Any CPU 218 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|Any CPU.ActiveCfg = Release|Any CPU 219 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|Any CPU.Build.0 = Release|Any CPU 220 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|Any CPU.Deploy.0 = Release|Any CPU 221 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|ARM.ActiveCfg = Release|Any CPU 222 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|ARM.Build.0 = Release|Any CPU 223 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|ARM.Deploy.0 = Release|Any CPU 224 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|iPhone.ActiveCfg = Release|Any CPU 225 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|iPhone.Build.0 = Release|Any CPU 226 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|iPhone.Deploy.0 = Release|Any CPU 227 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU 228 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU 229 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU 230 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|x64.ActiveCfg = Release|Any CPU 231 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|x64.Build.0 = Release|Any CPU 232 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|x64.Deploy.0 = Release|Any CPU 233 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|x86.ActiveCfg = Release|Any CPU 234 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|x86.Build.0 = Release|Any CPU 235 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.AppStore|x86.Deploy.0 = Release|Any CPU 236 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 237 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|Any CPU.Build.0 = Debug|Any CPU 238 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 239 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|ARM.ActiveCfg = Debug|Any CPU 240 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|ARM.Build.0 = Debug|Any CPU 241 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|ARM.Deploy.0 = Debug|Any CPU 242 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|iPhone.ActiveCfg = Debug|Any CPU 243 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|iPhone.Build.0 = Debug|Any CPU 244 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|iPhone.Deploy.0 = Debug|Any CPU 245 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 246 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 247 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU 248 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|x64.ActiveCfg = Debug|Any CPU 249 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|x64.Build.0 = Debug|Any CPU 250 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|x64.Deploy.0 = Debug|Any CPU 251 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|x86.ActiveCfg = Debug|Any CPU 252 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|x86.Build.0 = Debug|Any CPU 253 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Debug|x86.Deploy.0 = Debug|Any CPU 254 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|Any CPU.ActiveCfg = Release|Any CPU 255 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|Any CPU.Build.0 = Release|Any CPU 256 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|Any CPU.Deploy.0 = Release|Any CPU 257 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|ARM.ActiveCfg = Release|Any CPU 258 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|ARM.Build.0 = Release|Any CPU 259 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|ARM.Deploy.0 = Release|Any CPU 260 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|iPhone.ActiveCfg = Release|Any CPU 261 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|iPhone.Build.0 = Release|Any CPU 262 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|iPhone.Deploy.0 = Release|Any CPU 263 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 264 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 265 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU 266 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|x64.ActiveCfg = Release|Any CPU 267 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|x64.Build.0 = Release|Any CPU 268 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|x64.Deploy.0 = Release|Any CPU 269 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|x86.ActiveCfg = Release|Any CPU 270 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|x86.Build.0 = Release|Any CPU 271 | {23E16784-23E8-4546-A31C-FBCE22ECA17F}.Release|x86.Deploy.0 = Release|Any CPU 272 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU 273 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU 274 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU 275 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU 276 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU 277 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU 278 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU 279 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU 280 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU 281 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|x64.Build.0 = Debug|Any CPU 282 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU 283 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Ad-Hoc|x86.Build.0 = Debug|Any CPU 284 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU 285 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|Any CPU.Build.0 = Debug|Any CPU 286 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|ARM.ActiveCfg = Debug|Any CPU 287 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|ARM.Build.0 = Debug|Any CPU 288 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|iPhone.ActiveCfg = Debug|Any CPU 289 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|iPhone.Build.0 = Debug|Any CPU 290 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU 291 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU 292 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|x64.ActiveCfg = Debug|Any CPU 293 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|x64.Build.0 = Debug|Any CPU 294 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|x86.ActiveCfg = Debug|Any CPU 295 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.AppStore|x86.Build.0 = Debug|Any CPU 296 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 297 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|Any CPU.Build.0 = Debug|Any CPU 298 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|ARM.ActiveCfg = Debug|Any CPU 299 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|ARM.Build.0 = Debug|Any CPU 300 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|iPhone.ActiveCfg = Debug|Any CPU 301 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|iPhone.Build.0 = Debug|Any CPU 302 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 303 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 304 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|x64.ActiveCfg = Debug|Any CPU 305 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|x64.Build.0 = Debug|Any CPU 306 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|x86.ActiveCfg = Debug|Any CPU 307 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Debug|x86.Build.0 = Debug|Any CPU 308 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|Any CPU.ActiveCfg = Release|Any CPU 309 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|Any CPU.Build.0 = Release|Any CPU 310 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|ARM.ActiveCfg = Release|Any CPU 311 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|ARM.Build.0 = Release|Any CPU 312 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|iPhone.ActiveCfg = Release|Any CPU 313 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|iPhone.Build.0 = Release|Any CPU 314 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 315 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 316 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|x64.ActiveCfg = Release|Any CPU 317 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|x64.Build.0 = Release|Any CPU 318 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|x86.ActiveCfg = Release|Any CPU 319 | {7B815C7C-D030-4441-9982-A23E2101FB9F}.Release|x86.Build.0 = Release|Any CPU 320 | EndGlobalSection 321 | GlobalSection(SolutionProperties) = preSolution 322 | HideSolutionNode = FALSE 323 | EndGlobalSection 324 | GlobalSection(ExtensibilityGlobals) = postSolution 325 | SolutionGuid = {11575775-DFF5-4AA6-BECA-CAADE5717B20} 326 | EndGlobalSection 327 | EndGlobal 328 | -------------------------------------------------------------------------------- /Plugin.Sensors/CardinalDirection.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | 3 | 4 | //namespace Plugin.Sensors 5 | //{ 6 | // public enum CardinalDirection 7 | // { 8 | // N, 9 | // NNE, 10 | // NE, 11 | // ENE, 12 | // E, 13 | // ESE, 14 | // SE, 15 | // SSE, 16 | // S, 17 | // SSW, 18 | // SW, 19 | // WSW, 20 | // W, 21 | // WNW, 22 | // NW, 23 | // NNW 24 | // } 25 | //} 26 | -------------------------------------------------------------------------------- /Plugin.Sensors/CompassAccuracy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public enum CompassAccuracy 7 | { 8 | Unknown, 9 | Unreliable, 10 | Approximate, 11 | High 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Plugin.Sensors/CompassReading.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public class CompassReading 7 | { 8 | public CompassReading(CompassAccuracy accuracy, double magHeading, double? trueHeading) 9 | { 10 | this.Accuracy = accuracy; 11 | this.MagneticHeading = magHeading; 12 | this.TrueHeading = trueHeading; 13 | } 14 | 15 | 16 | public CompassAccuracy Accuracy { get; } 17 | public double MagneticHeading { get; } 18 | public double? TrueHeading { get; } 19 | 20 | 21 | public override string ToString() => $"Magnetic: {this.MagneticHeading} - True: {this.TrueHeading} - Accuracy: {this.Accuracy}"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Plugin.Sensors/CrossSensors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public static partial class CrossSensors 7 | { 8 | const string ERROR = "[Plugin.Sensors] This is the bait library. Make sure to install the nuget package into your platform projects as well!"; 9 | 10 | 11 | static IAccelerometer currentAccel; 12 | public static IAccelerometer Accelerometer 13 | { 14 | get 15 | { 16 | if (currentAccel == null) 17 | throw new ArgumentException(ERROR); 18 | 19 | return currentAccel; 20 | } 21 | set => currentAccel = value; 22 | } 23 | 24 | 25 | static IAmbientLight currentLight; 26 | public static IAmbientLight AmbientLight 27 | { 28 | get 29 | { 30 | if (currentLight == null) 31 | throw new ArgumentException(ERROR); 32 | 33 | return currentLight; 34 | } 35 | set => currentLight = value; 36 | } 37 | 38 | 39 | static IBarometer currentBaro; 40 | public static IBarometer Barometer 41 | { 42 | get 43 | { 44 | if (currentBaro == null) 45 | throw new ArgumentException(ERROR); 46 | 47 | return currentBaro; 48 | } 49 | set => currentBaro = value; 50 | } 51 | 52 | 53 | static ICompass currentCompass; 54 | public static ICompass Compass 55 | { 56 | get 57 | { 58 | if (currentCompass == null) 59 | throw new ArgumentException(ERROR); 60 | 61 | return currentCompass; 62 | } 63 | set => currentCompass = value; 64 | } 65 | 66 | 67 | static IDeviceOrientation currentDeviceOrientation; 68 | public static IDeviceOrientation DeviceOrientation 69 | { 70 | get 71 | { 72 | if (currentDeviceOrientation == null) 73 | throw new ArgumentException(ERROR); 74 | 75 | return currentDeviceOrientation; 76 | } 77 | set => currentDeviceOrientation = value; 78 | } 79 | 80 | 81 | static IGyroscope currentGyro; 82 | public static IGyroscope Gyroscope 83 | { 84 | get 85 | { 86 | if (currentGyro == null) 87 | throw new ArgumentException(ERROR); 88 | 89 | return currentGyro; 90 | } 91 | set => currentGyro = value; 92 | } 93 | 94 | 95 | static IMagnetometer currentMagnetometer; 96 | public static IMagnetometer Magnetometer 97 | { 98 | get 99 | { 100 | if (currentMagnetometer == null) 101 | throw new ArgumentException(ERROR); 102 | 103 | return currentMagnetometer; 104 | } 105 | set => currentMagnetometer = value; 106 | } 107 | 108 | 109 | //static IMotionActivity currentMA; 110 | //public static IMotionActivity MotionActivity 111 | //{ 112 | // get 113 | // { 114 | // if (currentMA == null) 115 | // throw new ArgumentException(ERROR); 116 | 117 | // return currentMA; 118 | // } 119 | // set => currentMA = value; 120 | //} 121 | 122 | 123 | static IPedometer currentPedometer; 124 | public static IPedometer Pedometer 125 | { 126 | get 127 | { 128 | if (currentPedometer == null) 129 | throw new ArgumentException(ERROR); 130 | 131 | return currentPedometer; 132 | } 133 | set => currentPedometer = value; 134 | } 135 | 136 | 137 | static IProximity currentProximity; 138 | public static IProximity Proximity 139 | { 140 | get 141 | { 142 | if (currentProximity == null) 143 | throw new ArgumentException(ERROR); 144 | 145 | return currentProximity; 146 | } 147 | set => currentProximity = value; 148 | } 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /Plugin.Sensors/DeviceOrientation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public enum DeviceOrientation 7 | { 8 | Portrait, 9 | PortraitUpsideDown, 10 | LandscapeLeft, 11 | LandscapeRight 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Plugin.Sensors/Extensions.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | 3 | 4 | //namespace Plugin.Sensors 5 | //{ 6 | // public static class Extensions 7 | // { 8 | // public static CardinalDirection GetDirection(this CompassReading reading, bool useTrueHeading = false) 9 | // { 10 | // var r = useTrueHeading && reading.TrueHeading != null ? reading.TrueHeading.Value : reading.MagneticHeading; 11 | 12 | // return CardinalDirection.E; 13 | // } 14 | // } 15 | //} 16 | 17 | ////N - 348.75 - 11.25 18 | ////NNE - 11.25 - 33.75 19 | ////NE - 33.75 - 56.25 20 | ////ENE - 56.25 - 78.75 21 | ////E - 78.75 - 101.25 22 | ////ESE - 101.25 - 123.75 23 | ////SE - 123.75 - 146.25 24 | ////SSE - 146.25 - 168.75 25 | ////S - 168.75 - 191.25 26 | ////SSW - 191.25 - 213.75 27 | ////SW - 213.75 - 236.25 28 | ////WSW - 236.25 - 258.75 29 | ////W - 258.75 - 281.25 30 | ////WNW - 281.25 - 303.75 31 | ////NW - 303.75 - 326.25 32 | ////NNW - 326.25 - 348.75 33 | -------------------------------------------------------------------------------- /Plugin.Sensors/IAccelerometer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public interface IAccelerometer : IMotionSensor 7 | { 8 | 9 | //IObservable WhenShaken(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Plugin.Sensors/IAmbientLight.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public interface IAmbientLight : ISensor 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Plugin.Sensors/IBarometer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public interface IBarometer : ISensor 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Plugin.Sensors/ICompass.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public interface ICompass : ISensor 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Plugin.Sensors/IDeviceOrientation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Plugin.Sensors 4 | { 5 | public interface IDeviceOrientation : ISensor 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Plugin.Sensors/IGyroscope.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public interface IGyroscope : IMotionSensor 7 | { 8 | // TODO: uncalibrated seems to be a common option 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Plugin.Sensors/IMagnetometer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public interface IMagnetometer : IMotionSensor 7 | { 8 | // has uncalibrated version 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Plugin.Sensors/IMotionActivity.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | 3 | 4 | //namespace Plugin.Sensors 5 | //{ 6 | // public interface IMotionActivity 7 | // { 8 | // bool IsSupported { get; } 9 | // IObservable WhenActivityChanged(); 10 | // } 11 | //} 12 | -------------------------------------------------------------------------------- /Plugin.Sensors/IMotionSensor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public interface IMotionSensor : ISensor 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Plugin.Sensors/IPedometer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Plugin.Sensors 4 | { 5 | public interface IPedometer : ISensor 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Plugin.Sensors/IProximity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public interface IProximity : ISensor 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Plugin.Sensors/ISensor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public interface ISensor 7 | { 8 | bool IsAvailable { get; } 9 | IObservable WhenReadingTaken(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Plugin.Sensors/MotionActivityEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | [Flags] 7 | public enum MotionFlags 8 | { 9 | Unknown = 1, 10 | Stationary = 2, 11 | Walking = 4, 12 | Running = 8, 13 | Automotive = 16, 14 | Cycling = 32 15 | } 16 | 17 | 18 | public enum Confidence 19 | { 20 | Low, 21 | Medium, 22 | High 23 | } 24 | 25 | public class MotionActivityEvent 26 | { 27 | public MotionActivityEvent(MotionFlags flags, Confidence confidence, DateTime dt) 28 | { 29 | this.Motions = flags; 30 | this.Confidence = confidence; 31 | this.StartDate = dt; 32 | } 33 | 34 | 35 | public MotionFlags Motions { get; } 36 | public Confidence Confidence { get; } 37 | public DateTime StartDate { get; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Plugin.Sensors/MotionReading.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public class MotionReading 7 | { 8 | public MotionReading(double x, double y, double z) 9 | { 10 | this.X = x; 11 | this.Y = y; 12 | this.Z = z; 13 | } 14 | 15 | 16 | public double X { get; } 17 | public double Y { get; } 18 | public double Z { get; } 19 | 20 | 21 | public override string ToString() => $"X: {this.X} - Y: {this.Y} - Z: {this.Z}"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/AbstractSensor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reactive.Linq; 5 | using Android.App; 6 | using Android.Content; 7 | using Android.Hardware; 8 | 9 | 10 | namespace Plugin.Sensors 11 | { 12 | public abstract class AbstractSensor 13 | { 14 | readonly SensorManager sensorManager; 15 | readonly SensorType type; 16 | 17 | 18 | protected AbstractSensor(SensorType type) 19 | { 20 | this.type = type; 21 | this.sensorManager = (SensorManager)Application.Context.GetSystemService(Context.SensorService); 22 | this.IsAvailable = this.sensorManager.GetSensorList(type).Any(); 23 | } 24 | 25 | 26 | protected abstract T ToReading(SensorEvent e); 27 | 28 | 29 | public bool IsAvailable { get; } 30 | 31 | 32 | IObservable readOb; 33 | public IObservable WhenReadingTaken() 34 | { 35 | this.readOb = this.readOb ?? Observable.Create(ob => 36 | { 37 | var mgr = new AcrSensorManager(this.sensorManager); 38 | //var delay = this.ToSensorDelay(this.ReportInterval); 39 | 40 | mgr.Start(this.type, SensorDelay.Fastest, e => 41 | { 42 | var reading = this.ToReading(e); 43 | ob.OnNext(reading); 44 | }); 45 | return () => mgr.Stop(); 46 | }) 47 | .Publish() 48 | .RefCount(); 49 | 50 | return this.readOb; 51 | } 52 | 53 | 54 | //protected SensorDelay ToSensorDelay(TimeSpan timeSpan) 55 | //{ 56 | // if (timeSpan.TotalMilliseconds <= 100) 57 | // return SensorDelay.Fastest; 58 | 59 | // if (timeSpan.TotalMilliseconds <= 250) 60 | // return SensorDelay.Game; 61 | 62 | // if (timeSpan.TotalMilliseconds <= 500) 63 | // return SensorDelay.Ui; 64 | 65 | // return SensorDelay.Normal; 66 | //} 67 | } 68 | } -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/AccelerometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Hardware; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class AccelerometerImpl : AbstractSensor, IAccelerometer 8 | { 9 | public AccelerometerImpl() : base(SensorType.Accelerometer) {} 10 | protected override MotionReading ToReading(SensorEvent e) => new MotionReading(e.Values[0], e.Values[1], e.Values[2]); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/AcrSensorManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Hardware; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class AcrSensorManager : Java.Lang.Object, ISensorEventListener 8 | { 9 | readonly SensorManager sensorManager; 10 | Action action; 11 | 12 | 13 | public AcrSensorManager(SensorManager sensorManager) 14 | { 15 | this.sensorManager = sensorManager; 16 | } 17 | 18 | 19 | public bool Start(SensorType sensorType, SensorDelay delay, Action sensorAction) 20 | { 21 | this.action = sensorAction; 22 | var sensor = this.sensorManager.GetDefaultSensor(sensorType); 23 | var result = this.sensorManager.RegisterListener(this, sensor, delay); 24 | return result; 25 | } 26 | 27 | 28 | public void Stop() => this.sensorManager.UnregisterListener(this); 29 | 30 | 31 | public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy) 32 | { 33 | } 34 | 35 | 36 | public void OnSensorChanged(SensorEvent e) => this.action(e); 37 | } 38 | } -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/AmbientLightImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Hardware; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class AmbientLightImpl : AbstractSensor, IAmbientLight 8 | { 9 | public AmbientLightImpl() : base(SensorType.Light) {} 10 | protected override double ToReading(SensorEvent e) => e.Values[0]; 11 | } 12 | } -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/BarometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Hardware; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class BarometerImpl : AbstractSensor, IBarometer 8 | { 9 | public BarometerImpl() : base(SensorType.Pressure) {} 10 | 11 | 12 | //1 meter sea water [msw] = 100 hectopascal [hPa] 13 | protected override double ToReading(SensorEvent e) => e.Values[0]; // hpa 14 | } 15 | } -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/CompassImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reactive.Linq; 4 | using Android.App; 5 | using Android.Content; 6 | using Android.Hardware; 7 | using Math = Java.Lang.Math; 8 | 9 | 10 | namespace Plugin.Sensors 11 | { 12 | public class CompassImpl : ICompass 13 | { 14 | readonly object syncLock; 15 | readonly SensorManager sensorManager; 16 | readonly float[] rMatrix = new float[9]; 17 | readonly float[] orientation = new float[3]; 18 | float[] lastAccel; 19 | float[] lastMag; 20 | 21 | 22 | public CompassImpl() 23 | { 24 | this.syncLock = new object(); 25 | this.sensorManager = (SensorManager)Application.Context.GetSystemService(Context.SensorService); 26 | } 27 | 28 | 29 | public bool IsAvailable => this.sensorManager.GetDefaultSensor(SensorType.Accelerometer) != null && 30 | this.sensorManager.GetDefaultSensor(SensorType.MagneticField) != null; 31 | 32 | 33 | IObservable readOb; 34 | public IObservable WhenReadingTaken() 35 | { 36 | if (!this.IsAvailable) 37 | return Observable.Empty(); 38 | 39 | this.readOb = this.readOb ?? Observable.Create(ob => 40 | { 41 | var accelMgr = new AcrSensorManager(this.sensorManager); 42 | var magMgr = new AcrSensorManager(this.sensorManager); 43 | accelMgr.Start(SensorType.Accelerometer, SensorDelay.Fastest, e => 44 | { 45 | lock (this.syncLock) 46 | { 47 | this.lastAccel = e.Values.ToArray(); 48 | this.Calc(ob); 49 | } 50 | }); 51 | magMgr.Start(SensorType.MagneticField, SensorDelay.Fastest, e => 52 | { 53 | lock (this.syncLock) 54 | { 55 | this.lastMag = e.Values.ToArray(); 56 | this.Calc(ob); 57 | } 58 | }); 59 | return () => 60 | { 61 | accelMgr.Stop(); 62 | magMgr.Stop(); 63 | }; 64 | }) 65 | .Publish() 66 | .RefCount(); 67 | 68 | return this.readOb; 69 | } 70 | 71 | 72 | void Calc(IObserver ob) 73 | { 74 | if (this.lastMag == null || this.lastAccel == null) 75 | return; 76 | 77 | SensorManager.GetRotationMatrix(this.rMatrix, null, this.lastAccel, this.lastMag); 78 | SensorManager.GetOrientation(this.rMatrix, this.orientation); 79 | var degrees = (Math.ToDegrees(this.orientation[0]) + 360) % 360; 80 | 81 | // TODO: not so allocatey 82 | // TODO: get compass accuracy 83 | // TODO: calculate true north 84 | ob.OnNext(new CompassReading(CompassAccuracy.Approximate, degrees, null)); 85 | 86 | // clear for fresh read 87 | this.lastMag = null; 88 | this.lastAccel = null; 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/CrossSensors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public static partial class CrossSensors 7 | { 8 | static CrossSensors() 9 | { 10 | Accelerometer = new AccelerometerImpl(); 11 | AmbientLight = new AmbientLightImpl(); 12 | Barometer = new BarometerImpl(); 13 | Compass = new CompassImpl(); 14 | DeviceOrientation = new DeviceOrientationImpl(); 15 | Gyroscope = new GyroscopeImpl(); 16 | Magnetometer = new MagnetometerImpl(); 17 | //MotionActivity = new MotionActivityImpl(); 18 | Pedometer = new PedometerImpl(); 19 | Proximity = new ProximityImpl(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/DeviceOrientationImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Hardware; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class DeviceOrientationImpl : AbstractSensor, IDeviceOrientation 8 | { 9 | public DeviceOrientationImpl() : base(SensorType.Orientation) {} 10 | 11 | 12 | protected override DeviceOrientation ToReading(SensorEvent e) 13 | { 14 | var degrees = e.Values[0]; 15 | if (degrees >= 0 && degrees < 90) 16 | return DeviceOrientation.Portrait; 17 | 18 | if (degrees >= 90 && degrees < 180) 19 | return DeviceOrientation.LandscapeLeft; 20 | 21 | if (degrees >= 180 && degrees < 270) 22 | return DeviceOrientation.PortraitUpsideDown; 23 | 24 | if (degrees >= 270 && degrees < 360) 25 | return DeviceOrientation.LandscapeRight; 26 | 27 | throw new ArgumentException("Invalid rotational degrees - " + degrees); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/GyroscopeImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Hardware; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class GyroscopeImpl : AbstractSensor, IGyroscope 8 | { 9 | public GyroscopeImpl() : base(SensorType.Gyroscope) {} 10 | 11 | 12 | protected override MotionReading ToReading(SensorEvent e) => new MotionReading(e.Values[0], e.Values[1], e.Values[2]); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/MagnetometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Hardware; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class MagnetometerImpl : AbstractSensor, IMagnetometer 8 | { 9 | public MagnetometerImpl() : base(SensorType.MagneticField) {} 10 | protected override MotionReading ToReading(SensorEvent e) => new MotionReading(e.Values[0], e.Values[1], e.Values[2]); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/MotionActivityImpl.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using System.Net.Mime; 3 | //using System.Reactive.Linq; 4 | //using Android.App; 5 | //using Android.Gms.Awareness; 6 | //using Android.Gms.Common.Apis; 7 | //using Android.Gms.Extensions; 8 | //using Android.Gms.Location; 9 | //using Android.Gms.Tasks; 10 | 11 | 12 | //namespace Plugin.Sensors 13 | //{ 14 | // public class MotionActivityImpl : Java.Lang.Object, 15 | // IMotionActivity, 16 | // IOnSuccessListener, 17 | // IOnFailureListener 18 | // { 19 | // public bool IsSupported => true; 20 | 21 | // // 22 | // public IObservable WhenActivityChanged() => Observable.Create(async ob => 23 | // { 24 | // var client1 = await new GoogleApiClient.Builder(Application.Context) 25 | // //.AddApi(Awareness) 26 | // .AddConnectionCallbacks(() => 27 | // { 28 | // //Connected Successful 29 | // }) 30 | // .BuildAndConnectAsync((i) =>{ }); 31 | 32 | // //SnapshotClient.GetDetectedActivityAsync() 33 | // //var request = new ActivityTransition.Builder(); 34 | // //new ActivityTransitionRequest(); 35 | // //new ActivityTransition.Builder(); 36 | // //new Awareness().api.GetDetectedActivityAsync(null).Result.Status.HasResolution; 37 | // var client = ActivityRecognition.GetClient(Application.Context); 38 | 39 | // var task = client.RequestActivityUpdates(0, null); 40 | // task.AddOnSuccessListener(this); 41 | // task.AddOnFailureListener(this); 42 | 43 | // return () => { }; 44 | // }); 45 | 46 | 47 | // public void OnFailure(Java.Lang.Exception e) 48 | // { 49 | // throw new NotImplementedException(); 50 | // } 51 | 52 | 53 | // public void OnSuccess(Java.Lang.Object result) 54 | // { 55 | // throw new NotImplementedException(); 56 | // } 57 | // } 58 | //} 59 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/PedometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Hardware; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class PedometerImpl : AbstractSensor, IPedometer 8 | { 9 | public PedometerImpl() : base(SensorType.StepCounter) {} 10 | protected override int ToReading(SensorEvent e) => Convert.ToInt32(e.Values[0]); 11 | } 12 | } -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Android/ProximityImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Hardware; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class ProximityImpl : AbstractSensor, IProximity 8 | { 9 | public ProximityImpl() : base(SensorType.Proximity) {} 10 | protected override bool ToReading(SensorEvent e) => e.Values[0] < e.Sensor.MaximumRange; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Tizen/AccelerometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public class AccelerometerImpl : IAccelerometer 7 | { 8 | public bool IsAvailable { get; } 9 | public IObservable WhenReadingTaken() 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Tizen/AmbientLightImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public class AmbientLightImpl : IAmbientLight 7 | { 8 | public bool IsAvailable { get; } 9 | public IObservable WhenReadingTaken() 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Tizen/CrossSensors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public static partial class CrossSensors 7 | { 8 | static CrossSensors() 9 | { 10 | Accelerometer = new AccelerometerImpl(); 11 | AmbientLight = new AmbientLightImpl(); 12 | Barometer = new BarometerImpl(); 13 | Compass = new CompassImpl(); 14 | DeviceOrientation = new DeviceOrientationImpl(); 15 | Gyroscope = new GyroscopeImpl(); 16 | Magnetometer = new MagnetometerImpl(); 17 | Pedometer = new PedometerImpl(); 18 | Proximity = new ProximityImpl(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Tizen/DeviceOrientationImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public class DeviceOrientationImpl : IDeviceOrientation 7 | { 8 | public bool IsAvailable { get; } 9 | public IObservable WhenReadingTaken() 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Tizen/GyroscopeImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public class GyroscopeImpl : IGyroscope 7 | { 8 | public bool IsAvailable { get; } 9 | public IObservable WhenReadingTaken() 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Tizen/MagnetometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public class MagnetometerImpl : IMagnetometer 7 | { 8 | public bool IsAvailable { get; } 9 | public IObservable WhenReadingTaken() 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/AccelerometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Windows.Devices.Sensors; 4 | using Windows.Foundation; 5 | 6 | 7 | namespace Plugin.Sensors 8 | { 9 | public class AccelerometerImpl : IAccelerometer 10 | { 11 | readonly Accelerometer accel; 12 | 13 | 14 | public AccelerometerImpl() 15 | { 16 | this.accel = Accelerometer.GetDefault(); 17 | } 18 | 19 | 20 | public bool IsAvailable => this.accel != null; 21 | 22 | 23 | IObservable readOb; 24 | public IObservable WhenReadingTaken() 25 | { 26 | this.readOb = this.readOb ?? Observable.Create(ob => 27 | { 28 | var handler = new TypedEventHandler((sender, args) => 29 | ob.OnNext(new MotionReading( 30 | args.Reading.AccelerationX, 31 | args.Reading.AccelerationY, 32 | args.Reading.AccelerationZ 33 | )) 34 | ); 35 | this.accel.ReadingChanged += handler; 36 | 37 | return () => this.accel.ReadingChanged -= handler; 38 | }) 39 | .Publish() 40 | .RefCount(); 41 | 42 | return this.readOb; 43 | } 44 | 45 | 46 | public IObservable WhenShaken() 47 | { 48 | throw new NotImplementedException(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/AmbientLightImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Windows.Devices.Sensors; 4 | using Windows.Foundation; 5 | using Windows.UI.Composition; 6 | 7 | 8 | namespace Plugin.Sensors 9 | { 10 | public class AmbientLightImpl : IAmbientLight 11 | { 12 | readonly LightSensor sensor; 13 | 14 | 15 | public AmbientLightImpl() 16 | { 17 | this.sensor = LightSensor.GetDefault(); 18 | } 19 | 20 | 21 | public bool IsAvailable => this.sensor != null; 22 | 23 | 24 | IObservable readOb; 25 | public IObservable WhenReadingTaken() 26 | { 27 | this.readOb = this.readOb ?? Observable.Create(ob => 28 | { 29 | var handler = new TypedEventHandler((sender, args) => 30 | ob.OnNext(args.Reading.IlluminanceInLux) 31 | ); 32 | this.sensor.ReadingChanged += handler; 33 | return () => this.sensor.ReadingChanged -= handler; 34 | }) 35 | .Publish() 36 | .RefCount(); 37 | 38 | return this.readOb; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/BarometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Windows.Devices.Sensors; 4 | using Windows.Foundation; 5 | 6 | 7 | namespace Plugin.Sensors 8 | { 9 | public class BarometerImpl : IBarometer 10 | { 11 | readonly Barometer barometer; 12 | 13 | 14 | public BarometerImpl() 15 | { 16 | this.barometer = Barometer.GetDefault(); 17 | } 18 | 19 | 20 | public bool IsAvailable => this.barometer != null; 21 | 22 | 23 | IObservable readOb; 24 | public IObservable WhenReadingTaken() 25 | { 26 | this.readOb = this.readOb ?? Observable.Create(ob => 27 | { 28 | var handler = new TypedEventHandler((sender, args) => 29 | ob.OnNext(args.Reading.StationPressureInHectopascals) 30 | ); 31 | this.barometer.ReadingChanged += handler; 32 | return () => this.barometer.ReadingChanged -= handler; 33 | }) 34 | .Publish() 35 | .RefCount(); 36 | 37 | return this.readOb; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/CompassImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Windows.Devices.Sensors; 4 | using Windows.Foundation; 5 | 6 | 7 | namespace Plugin.Sensors 8 | { 9 | public class CompassImpl : ICompass 10 | { 11 | readonly Compass compass; 12 | 13 | 14 | public CompassImpl() 15 | { 16 | this.compass = Compass.GetDefault(); 17 | } 18 | 19 | 20 | public bool IsAvailable => this.compass != null; 21 | 22 | 23 | IObservable readOb; 24 | public IObservable WhenReadingTaken() 25 | { 26 | this.readOb = this.readOb ?? Observable.Create(ob => 27 | { 28 | var handler = new TypedEventHandler((sender, args) => 29 | { 30 | var accuracy = this.FromNative(args.Reading.HeadingAccuracy); 31 | var read = new CompassReading(accuracy, args.Reading.HeadingMagneticNorth, args.Reading.HeadingTrueNorth ?? 0); 32 | ob.OnNext(read); 33 | }); 34 | this.compass.ReadingChanged += handler; 35 | 36 | return () => this.compass.ReadingChanged -= handler; 37 | }) 38 | .Publish() 39 | .RefCount(); 40 | 41 | return this.readOb; 42 | } 43 | 44 | 45 | protected CompassAccuracy FromNative(MagnetometerAccuracy native) 46 | { 47 | switch (native) 48 | { 49 | case MagnetometerAccuracy.High: 50 | return CompassAccuracy.High; 51 | 52 | case MagnetometerAccuracy.Unreliable: 53 | return CompassAccuracy.Unreliable; 54 | 55 | ; case MagnetometerAccuracy.Approximate: 56 | return CompassAccuracy.Approximate; 57 | 58 | ; default: 59 | return CompassAccuracy.Unknown; 60 | ; } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/CrossSensors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public static partial class CrossSensors 7 | { 8 | static CrossSensors() 9 | { 10 | Accelerometer = new AccelerometerImpl(); 11 | AmbientLight = new AmbientLightImpl(); 12 | Barometer = new BarometerImpl(); 13 | Compass = new CompassImpl(); 14 | DeviceOrientation = new DeviceOrientationImpl(); 15 | Gyroscope = new GyroscopeImpl(); 16 | Magnetometer = new MagnetometerImpl(); 17 | //MotionActivity = new MotionActivityImpl(); 18 | Pedometer = new PedometerImpl(); 19 | Proximity = new ProximityImpl(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/DeviceOrientationImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Windows.Devices.Sensors; 4 | using Windows.Foundation; 5 | 6 | 7 | namespace Plugin.Sensors 8 | { 9 | public class DeviceOrientationImpl : IDeviceOrientation 10 | { 11 | readonly SimpleOrientationSensor sensor; 12 | 13 | 14 | public DeviceOrientationImpl() 15 | { 16 | this.sensor = SimpleOrientationSensor.GetDefault(); 17 | } 18 | 19 | 20 | public bool IsAvailable => this.sensor != null; 21 | 22 | 23 | IObservable readOb; 24 | public IObservable WhenReadingTaken() 25 | { 26 | this.readOb = this.readOb ?? Observable.Create(ob => 27 | { 28 | this.Broadcast(ob, this.sensor.GetCurrentOrientation()); // startwith 29 | var handler = new TypedEventHandler( 30 | (sender, args) => this.Broadcast(ob, args.Orientation)); 31 | 32 | this.sensor.OrientationChanged += handler; 33 | return () => this.sensor.OrientationChanged -= handler; 34 | }) 35 | .Publish() 36 | .RefCount() 37 | .Repeat(1); 38 | 39 | return this.readOb; 40 | } 41 | 42 | 43 | void Broadcast(IObserver ob, SimpleOrientation orientation) 44 | { 45 | switch (orientation) 46 | { 47 | case SimpleOrientation.NotRotated: 48 | ob.OnNext(DeviceOrientation.LandscapeLeft); 49 | break; 50 | 51 | case SimpleOrientation.Rotated90DegreesCounterclockwise: 52 | ob.OnNext(DeviceOrientation.Portrait); 53 | break; 54 | 55 | case SimpleOrientation.Rotated180DegreesCounterclockwise: 56 | ob.OnNext(DeviceOrientation.LandscapeRight); 57 | break; 58 | 59 | case SimpleOrientation.Rotated270DegreesCounterclockwise: 60 | ob.OnNext(DeviceOrientation.PortraitUpsideDown); 61 | break; 62 | } 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/GyroscopeImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Windows.Devices.Sensors; 4 | using Windows.Foundation; 5 | 6 | 7 | namespace Plugin.Sensors 8 | { 9 | public class GyroscopeImpl : IGyroscope 10 | { 11 | readonly Gyrometer gyrometer; 12 | 13 | 14 | public GyroscopeImpl() 15 | { 16 | this.gyrometer = Gyrometer.GetDefault(); 17 | } 18 | 19 | 20 | public bool IsAvailable => this.gyrometer != null; 21 | 22 | 23 | IObservable readOb; 24 | public IObservable WhenReadingTaken() 25 | { 26 | this.readOb = this.readOb ?? Observable.Create(ob => 27 | { 28 | var handler = new TypedEventHandler((sender, args) => 29 | ob.OnNext(new MotionReading( 30 | args.Reading.AngularVelocityX, 31 | args.Reading.AngularVelocityY, 32 | args.Reading.AngularVelocityZ 33 | )) 34 | ); 35 | this.gyrometer.ReadingChanged += handler; 36 | 37 | return () => this.gyrometer.ReadingChanged -= handler; 38 | }); 39 | return this.readOb; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/MagnetometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Windows.Devices.Sensors; 4 | using Windows.Foundation; 5 | 6 | 7 | namespace Plugin.Sensors 8 | { 9 | public class MagnetometerImpl : IMagnetometer 10 | { 11 | readonly Magnetometer magnetometer; 12 | 13 | 14 | public MagnetometerImpl() 15 | { 16 | this.magnetometer = Magnetometer.GetDefault(); 17 | } 18 | 19 | 20 | public TimeSpan ReportInterval { get; set; } 21 | public bool IsAvailable => this.magnetometer != null; 22 | 23 | 24 | IObservable readOb; 25 | public IObservable WhenReadingTaken() 26 | { 27 | this.readOb = this.readOb ?? Observable.Create(ob => 28 | { 29 | //this.magnetometer.ReportInterval; 30 | var handler = new TypedEventHandler((sender, args) => 31 | ob.OnNext(new MotionReading( 32 | args.Reading.MagneticFieldX, 33 | args.Reading.MagneticFieldY, 34 | args.Reading.MagneticFieldZ 35 | // TODO: accuracy on this 36 | )) 37 | ); 38 | this.magnetometer.ReadingChanged += handler; 39 | return () => this.magnetometer.ReadingChanged -= handler; 40 | }); 41 | return this.readOb; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/MotionActivityImpl.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using System.Reactive.Linq; 3 | 4 | 5 | //namespace Plugin.Sensors 6 | //{ 7 | // public class MotionActivityImpl : IMotionActivity 8 | // { 9 | // public bool IsSupported => false; 10 | // public IObservable WhenActivityChanged() 11 | // => Observable.Empty(); 12 | // } 13 | //} 14 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/PedometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Windows.Devices.Sensors; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class PedometerImpl : IPedometer 8 | { 9 | //readonly Pedometer pedometer; 10 | 11 | 12 | public PedometerImpl() 13 | { 14 | //this.pedometer = Pedometer.GetDefaultAsync(); 15 | } 16 | 17 | 18 | public bool IsAvailable => false; 19 | 20 | 21 | public IObservable WhenReadingTaken() 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/Plugin.Sensors.rd.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/Uwp/ProximityImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Windows.Devices.Sensors; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class ProximityImpl : IProximity 8 | { 9 | public ProximityImpl() 10 | { 11 | //ProximitySensor.GetReadingsFromTriggerDetails() 12 | } 13 | 14 | 15 | public bool IsAvailable => false; 16 | 17 | 18 | public IObservable WhenReadingTaken() 19 | { 20 | throw new NotImplementedException(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/AbstractMotionSensor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using CoreMotion; 4 | 5 | 6 | namespace Plugin.Sensors 7 | { 8 | public abstract class AbstractMotionSensor 9 | { 10 | readonly CMMotionManager motionManager = new CMMotionManager(); 11 | 12 | 13 | protected abstract bool IsSensorAvailable(CMMotionManager mgr); 14 | protected abstract void Start(CMMotionManager mgr, IObserver ob); 15 | protected abstract void Stop(CMMotionManager mgr); 16 | protected abstract void SetReportInterval(CMMotionManager mgr, TimeSpan timeSpan); 17 | 18 | 19 | public bool IsAvailable => this.IsSensorAvailable(this.motionManager); 20 | 21 | 22 | TimeSpan reportInterval = TimeSpan.FromMilliseconds(500); 23 | public TimeSpan ReportInterval 24 | { 25 | get => this.reportInterval; 26 | set 27 | { 28 | this.reportInterval = value; 29 | this.SetReportInterval(this.motionManager, value); 30 | } 31 | } 32 | 33 | 34 | IObservable readOb; 35 | public IObservable WhenReadingTaken() 36 | { 37 | this.readOb = this.readOb ?? Observable.Create(ob => 38 | { 39 | this.Start(this.motionManager, ob); 40 | return () => this.Stop(this.motionManager); 41 | }) 42 | .Publish() 43 | .RefCount(); 44 | 45 | return this.readOb; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/AccelerometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CoreMotion; 3 | using Foundation; 4 | 5 | 6 | namespace Plugin.Sensors 7 | { 8 | public class AccelerometerImpl : AbstractMotionSensor, IAccelerometer 9 | { 10 | protected override bool IsSensorAvailable(CMMotionManager mgr) => mgr.AccelerometerAvailable; 11 | 12 | 13 | protected override void Start(CMMotionManager mgr, IObserver ob) 14 | => mgr.StartAccelerometerUpdates(NSOperationQueue.CurrentQueue ?? new NSOperationQueue(), (data, err) => 15 | ob.OnNext(new MotionReading(data.Acceleration.X, data.Acceleration.Y, data.Acceleration.Z)) 16 | ); 17 | 18 | 19 | protected override void Stop(CMMotionManager mgr) => mgr.StopAccelerometerUpdates(); 20 | protected override void SetReportInterval(CMMotionManager mgr, TimeSpan timeSpan) => mgr.AccelerometerUpdateInterval = timeSpan.TotalSeconds; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/AmbientLightImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | 4 | 5 | namespace Plugin.Sensors 6 | { 7 | public class AmbientLightImpl : IAmbientLight 8 | { 9 | public bool IsAvailable => false; 10 | public IObservable WhenReadingTaken() => Observable.Empty(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/BarometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using CoreMotion; 4 | using Foundation; 5 | 6 | 7 | namespace Plugin.Sensors 8 | { 9 | public class BarometerImpl : IBarometer 10 | { 11 | 12 | public bool IsAvailable => CMAltimeter.IsRelativeAltitudeAvailable; 13 | 14 | 15 | IObservable readOb; 16 | public IObservable WhenReadingTaken() 17 | { 18 | this.readOb = this.readOb ?? Observable.Create(ob => 19 | { 20 | var altimeter = new CMAltimeter(); 21 | altimeter.StartRelativeAltitudeUpdates(NSOperationQueue.CurrentQueue, (data, error) => 22 | ob.OnNext(data.Pressure.DoubleValue) // kilopascals 23 | ); 24 | return () => 25 | { 26 | altimeter.StopRelativeAltitudeUpdates(); 27 | altimeter.Dispose(); 28 | }; 29 | }) 30 | .Publish() 31 | .RefCount(); 32 | 33 | return this.readOb; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/CompassImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using CoreLocation; 4 | 5 | 6 | namespace Plugin.Sensors 7 | { 8 | public class CompassImpl : ICompass 9 | { 10 | public bool IsAvailable => CLLocationManager.HeadingAvailable; 11 | 12 | 13 | IObservable readOb; 14 | public IObservable WhenReadingTaken() 15 | { 16 | this.readOb = this.readOb ?? Observable.Create(ob => 17 | { 18 | var handler = new EventHandler((sender, args) => 19 | { 20 | var accuracy = this.FromNative(args.NewHeading.HeadingAccuracy); 21 | var read = new CompassReading(accuracy, args.NewHeading.MagneticHeading, args.NewHeading.TrueHeading); 22 | ob.OnNext(read); 23 | }); 24 | var lm = new CLLocationManager 25 | { 26 | DesiredAccuracy = CLLocation.AccuracyBest, 27 | HeadingFilter = 1 28 | }; 29 | lm.UpdatedHeading += handler; 30 | lm.StartUpdatingHeading(); 31 | 32 | return () => 33 | { 34 | lm.StopUpdatingHeading(); 35 | lm.UpdatedHeading -= handler; 36 | }; 37 | }) 38 | .Publish() 39 | .RefCount(); 40 | 41 | return this.readOb; 42 | } 43 | 44 | 45 | protected CompassAccuracy FromNative(double value) => value < 0 ? CompassAccuracy.Unreliable : CompassAccuracy.High; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/CrossSensors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Plugin.Sensors 5 | { 6 | public static partial class CrossSensors 7 | { 8 | static CrossSensors() 9 | { 10 | Accelerometer = new AccelerometerImpl(); 11 | AmbientLight = new AmbientLightImpl(); 12 | Barometer = new BarometerImpl(); 13 | Compass = new CompassImpl(); 14 | DeviceOrientation = new DeviceOrientationImpl(); 15 | Gyroscope = new GyroscopeImpl(); 16 | Magnetometer = new MagnetometerImpl(); 17 | //MotionActivity = new MotionActivityImpl(); 18 | Pedometer = new PedometerImpl(); 19 | Proximity = new ProximityImpl(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/DeviceOrientationImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Foundation; 4 | using UIKit; 5 | 6 | 7 | namespace Plugin.Sensors 8 | { 9 | public class DeviceOrientationImpl : IDeviceOrientation 10 | { 11 | public bool IsAvailable { get; } = true; 12 | 13 | 14 | IObservable readOb; 15 | public IObservable WhenReadingTaken() 16 | { 17 | this.readOb = this.readOb ?? Observable.Create(ob => 18 | { 19 | this.BroadcastCurrent(ob); // start with 20 | 21 | var observer = NSNotificationCenter.DefaultCenter.AddObserver( 22 | UIApplication.DidChangeStatusBarOrientationNotification, 23 | _ => this.BroadcastCurrent(ob) 24 | ); 25 | UIApplication.SharedApplication.InvokeOnMainThread(UIDevice.CurrentDevice.BeginGeneratingDeviceOrientationNotifications); 26 | 27 | return () => 28 | { 29 | UIApplication.SharedApplication.InvokeOnMainThread(UIDevice.CurrentDevice.EndGeneratingDeviceOrientationNotifications); 30 | NSNotificationCenter.DefaultCenter.RemoveObserver(observer); 31 | }; 32 | }) 33 | .Publish() 34 | .RefCount() 35 | .Repeat(1); 36 | 37 | return this.readOb; 38 | } 39 | 40 | 41 | void BroadcastCurrent(IObserver ob) => UIApplication.SharedApplication.InvokeOnMainThread(() => 42 | { 43 | switch (UIDevice.CurrentDevice.Orientation) 44 | { 45 | case UIDeviceOrientation.Portrait: 46 | ob.OnNext(DeviceOrientation.Portrait); 47 | break; 48 | 49 | case UIDeviceOrientation.PortraitUpsideDown: 50 | ob.OnNext(DeviceOrientation.PortraitUpsideDown); 51 | break; 52 | 53 | case UIDeviceOrientation.LandscapeRight: 54 | ob.OnNext(DeviceOrientation.LandscapeRight); 55 | break; 56 | 57 | case UIDeviceOrientation.LandscapeLeft: 58 | ob.OnNext(DeviceOrientation.LandscapeLeft); 59 | break; 60 | } 61 | }); 62 | } 63 | } -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/GyroscopeImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CoreMotion; 3 | using Foundation; 4 | 5 | 6 | namespace Plugin.Sensors 7 | { 8 | public class GyroscopeImpl : AbstractMotionSensor, IGyroscope 9 | { 10 | protected override bool IsSensorAvailable(CMMotionManager mgr) => mgr.AccelerometerAvailable; 11 | protected override void Start(CMMotionManager mgr, IObserver ob) => 12 | mgr.StartGyroUpdates(NSOperationQueue.CurrentQueue ?? new NSOperationQueue(), (data, err) => 13 | ob.OnNext(new MotionReading(data.RotationRate.x, data.RotationRate.y, data.RotationRate.z)) 14 | ); 15 | 16 | 17 | protected override void Stop(CMMotionManager mgr) => mgr.StopGyroUpdates(); 18 | protected override void SetReportInterval(CMMotionManager mgr, TimeSpan timeSpan) => mgr.GyroUpdateInterval = timeSpan.TotalSeconds; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/MagnetometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CoreMotion; 3 | using Foundation; 4 | 5 | 6 | namespace Plugin.Sensors 7 | { 8 | public class MagnetometerImpl : AbstractMotionSensor, IMagnetometer 9 | { 10 | protected override bool IsSensorAvailable(CMMotionManager mgr) 11 | => mgr.MagnetometerAvailable; 12 | 13 | 14 | protected override void Start(CMMotionManager mgr, IObserver ob) 15 | => mgr.StartMagnetometerUpdates(NSOperationQueue.CurrentQueue ?? new NSOperationQueue(), (data, err) => 16 | ob.OnNext(new MotionReading(data.MagneticField.X, data.MagneticField.Y, data.MagneticField.Z)) 17 | ); 18 | 19 | 20 | protected override void Stop(CMMotionManager mgr) 21 | => mgr.StopMagnetometerUpdates(); 22 | 23 | 24 | protected override void SetReportInterval(CMMotionManager mgr, TimeSpan timeSpan) 25 | => mgr.MagnetometerUpdateInterval = timeSpan.TotalSeconds; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/MotionActivityImpl.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using System.Reactive.Linq; 3 | //using CoreMotion; 4 | //using Foundation; 5 | 6 | 7 | //namespace Plugin.Sensors 8 | //{ 9 | // public class MotionActivityImpl : IMotionActivity 10 | // { 11 | // public bool IsSupported => true; 12 | 13 | // public IObservable WhenActivityChanged() 14 | // => Observable.Create(ob => 15 | // { 16 | // //CMMotionActivityManager.IsActivityAvailable 17 | // //CMMotionActivityManager.AuthorizationStatus == CMAuthorizationStatus.Authorized 18 | // var am = new CMMotionActivityManager(); 19 | // am.StartActivityUpdates(NSOperationQueue.CurrentQueue, target => 20 | // { 21 | // var flags = MotionFlags.Unknown; 22 | // if (!target.Unknown) 23 | // { 24 | // flags &= MotionFlags.Unknown; 25 | // if (target.Automotive) 26 | // flags |= MotionFlags.Automotive; 27 | 28 | // if (target.Cycling) 29 | // flags |= MotionFlags.Cycling; 30 | 31 | // if (target.Running) 32 | // flags |= MotionFlags.Running; 33 | 34 | // if (target.Stationary) 35 | // flags |= MotionFlags.Stationary; 36 | 37 | // if (target.Walking) 38 | // flags |= MotionFlags.Walking; 39 | // } 40 | 41 | // var conf = (Confidence) Enum.Parse(typeof(Confidence), target.Confidence.ToString(), true); 42 | // ob.OnNext(new MotionActivityEvent(flags, conf, (DateTime)target.StartDate)); 43 | // }); 44 | // return () => 45 | // { 46 | // am.StopActivityUpdates(); 47 | // am.Dispose(); 48 | // }; 49 | // }) 50 | // .Repeat(1); 51 | // } 52 | //} 53 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/PedometerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using CoreMotion; 4 | using Foundation; 5 | 6 | 7 | namespace Plugin.Sensors 8 | { 9 | public class PedometerImpl : IPedometer 10 | { 11 | public bool IsAvailable => CMStepCounter.IsStepCountingAvailable; 12 | 13 | 14 | IObservable stepOb; 15 | public IObservable WhenReadingTaken() 16 | { 17 | this.stepOb = this.stepOb ?? Observable.Create(ob => 18 | { 19 | var scm = new CMStepCounter(); 20 | scm.StartStepCountingUpdates(NSOperationQueue.CurrentQueue ?? new NSOperationQueue(), 1, (steps, timestamp, error) => 21 | ob.OnNext((int)steps) 22 | ); 23 | return () => 24 | { 25 | scm.StopStepCountingUpdates(); 26 | scm.Dispose(); 27 | }; 28 | }) 29 | .Publish() 30 | .RefCount(); 31 | 32 | return this.stepOb; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Plugin.Sensors/Platforms/iOS/ProximityImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Foundation; 4 | using UIKit; 5 | 6 | 7 | namespace Plugin.Sensors 8 | { 9 | public class ProximityImpl : IProximity 10 | { 11 | public bool IsAvailable => true; 12 | 13 | 14 | IObservable readOb; 15 | public IObservable WhenReadingTaken() 16 | { 17 | this.readOb = this.readOb ?? Observable.Create(ob => 18 | { 19 | UIDevice.CurrentDevice.ProximityMonitoringEnabled = true; 20 | var observer = NSNotificationCenter 21 | .DefaultCenter 22 | .AddObserver( 23 | UIDevice.ProximityStateDidChangeNotification, 24 | _ => ob.OnNext(UIDevice.CurrentDevice.ProximityState) 25 | ); 26 | 27 | return () => 28 | { 29 | UIDevice.CurrentDevice.ProximityMonitoringEnabled = false; 30 | NSNotificationCenter.DefaultCenter.RemoveObserver(observer); 31 | }; 32 | }) 33 | .StartWith(UIDevice.CurrentDevice.ProximityState) 34 | .Publish() 35 | .RefCount(); 36 | 37 | return this.readOb; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Plugin.Sensors/Plugin.Sensors.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;MonoAndroid80;Xamarin.iOS10;uap10.0 5 | true 6 | Allan Ritchie 7 | 8 | Cross Platform Reactive Motion Sensors Plugin for Xamarin and Windows 9 | 10 | Available Sensors 11 | * Accelerometer 12 | * Ambient Light 13 | * Barometer 14 | * Compass 15 | * Device Orientation 16 | * Gyroscope 17 | * Magnetometer 18 | * Pedometer 19 | * Proximity 20 | 21 | Supported Platforms 22 | * NET Standard 23 | * Android 4.3+ 24 | * iOS 8+ 25 | * Windows UWP 26 | 27 | https://github.com/aritchie/sensors/blob/master/LICENSE.md 28 | ios android xamarin rx reactive motion sensors 29 | $(AssemblyName) ($(TargetFramework)) 30 | $(PackageVersion) 31 | 2.5.0 32 | https://github.com/aritchie/sensors 33 | https://github.com/aritchie/sensors/blob/master/changelog.md 34 | https://github.com/aritchie/sensors 35 | git 36 | True 37 | True 38 | true 39 | true 40 | $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb 41 | 42 | 43 | 44 | 10.0.16299.0 45 | 10.0.16299.0 46 | 47 | 48 | 49 | full 50 | true 51 | 52 | 53 | 54 | pdbonly 55 | true 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with you package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.App; 3 | using Android.Content.PM; 4 | using Android.OS; 5 | using Xamarin.Forms; 6 | using Xamarin.Forms.Platform.Android; 7 | 8 | 9 | namespace Sample.Droid 10 | { 11 | [Activity( 12 | Label = "Sensors", 13 | Icon = "@drawable/icon", 14 | Theme = "@style/MainTheme", 15 | MainLauncher = true, 16 | ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation 17 | )] 18 | public class MainActivity : FormsAppCompatActivity 19 | { 20 | protected override void OnCreate(Bundle bundle) 21 | { 22 | TabLayoutResource = Resource.Layout.Tabbar; 23 | ToolbarResource = Resource.Layout.Toolbar; 24 | 25 | base.OnCreate(bundle); 26 | 27 | Forms.Init(this, bundle); 28 | this.LoadApplication(new App()); 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("Sample.Droid")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("Sample.Droid")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.Droid/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.Droid/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.Droid/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.Droid/Resources/drawable/icon.png -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/layout/Tabbar.axml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/layout/Toolbar.axml: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Sample.Droid.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {23E16784-23E8-4546-A31C-FBCE22ECA17F} 9 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Library 11 | Properties 12 | Sample.Droid 13 | Sample.Droid 14 | 512 15 | true 16 | Resources\Resource.Designer.cs 17 | Off 18 | Properties\AndroidManifest.xml 19 | false 20 | v8.1 21 | armeabi,armeabi-v7a,x86 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | true 33 | full 34 | false 35 | bin\Debug\ 36 | DEBUG;TRACE 37 | prompt 38 | 4 39 | True 40 | None 41 | armeabi;armeabi-v7a;x86 42 | 43 | 44 | pdbonly 45 | true 46 | bin\Release\ 47 | TRACE 48 | prompt 49 | 4 50 | False 51 | SdkOnly 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 4.4.0 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 3.3.0.912540 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | {150e72bd-08e5-48b6-a7de-010ec70b4545} 107 | Plugin.Sensors 108 | 109 | 110 | {7b815c7c-d030-4441-9982-a23e2101fb9f} 111 | Sample 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sample/Sample.UWP/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /Sample/Sample.UWP/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Windows.ApplicationModel; 3 | using Windows.ApplicationModel.Activation; 4 | using Windows.UI.Xaml; 5 | using Windows.UI.Xaml.Navigation; 6 | using Xamarin.Forms; 7 | using Application = Windows.UI.Xaml.Application; 8 | using Frame = Windows.UI.Xaml.Controls.Frame; 9 | 10 | 11 | namespace Sample.UWP 12 | { 13 | sealed partial class App : Application 14 | { 15 | public App() 16 | { 17 | this.InitializeComponent(); 18 | this.Suspending += this.OnSuspending; 19 | } 20 | 21 | 22 | protected override void OnLaunched(LaunchActivatedEventArgs e) 23 | { 24 | var rootFrame = Window.Current.Content as Frame; 25 | 26 | if (rootFrame == null) 27 | { 28 | rootFrame = new Frame(); 29 | rootFrame.NavigationFailed += this.OnNavigationFailed; 30 | Forms.Init(e); 31 | 32 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 33 | { 34 | //TODO: Load state from previously suspended application 35 | } 36 | Window.Current.Content = rootFrame; 37 | } 38 | 39 | if (rootFrame.Content == null) 40 | { 41 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 42 | } 43 | Window.Current.Activate(); 44 | } 45 | 46 | 47 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 48 | { 49 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 50 | } 51 | 52 | 53 | void OnSuspending(object sender, SuspendingEventArgs e) 54 | { 55 | e.SuspendingOperation.GetDeferral().Complete(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/LockScreenLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/LockScreenLogo.scale-100.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/LockScreenLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/LockScreenLogo.scale-125.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/LockScreenLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/LockScreenLogo.scale-150.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/LockScreenLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/LockScreenLogo.scale-400.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/SplashScreen.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/SplashScreen.scale-125.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/SplashScreen.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/SplashScreen.scale-150.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square150x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square150x150Logo.scale-125.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square150x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square150x150Logo.scale-150.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/Assets/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.UWP/Assets/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /Sample/Sample.UWP/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Sample/Sample.UWP/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Sample/Sample.UWP/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Sample.UWP 5 | { 6 | public sealed partial class MainPage 7 | { 8 | public MainPage() 9 | { 10 | this.InitializeComponent(); 11 | this.LoadApplication(new Sample.App()); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Sample/Sample.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | Sample.UWP 18 | allan 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Sample/Sample.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Sample.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Sample.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Sample/Sample.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Sample/Sample.UWP/Sample.UWP.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x86 7 | {D8AD660F-2E4A-4604-A181-C26D6B78AA45} 8 | AppContainerExe 9 | Properties 10 | Sample.UWP 11 | Sample.UWP 12 | en-US 13 | UAP 14 | 10.0.16299.0 15 | 10.0.16299.0 16 | 14 17 | true 18 | 512 19 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 20 | Windows_TemporaryKey.pfx 21 | 22 | 23 | true 24 | bin\ARM\Debug\ 25 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 26 | ;2008 27 | full 28 | ARM 29 | false 30 | prompt 31 | true 32 | 33 | 34 | bin\ARM\Release\ 35 | TRACE;NETFX_CORE;WINDOWS_UWP 36 | true 37 | ;2008 38 | pdbonly 39 | ARM 40 | false 41 | prompt 42 | true 43 | true 44 | 45 | 46 | true 47 | bin\x64\Debug\ 48 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 49 | ;2008 50 | full 51 | x64 52 | false 53 | prompt 54 | true 55 | 56 | 57 | bin\x64\Release\ 58 | TRACE;NETFX_CORE;WINDOWS_UWP 59 | true 60 | ;2008 61 | pdbonly 62 | x64 63 | false 64 | prompt 65 | true 66 | true 67 | 68 | 69 | true 70 | bin\x86\Debug\ 71 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 72 | ;2008 73 | full 74 | x86 75 | false 76 | prompt 77 | true 78 | 79 | 80 | bin\x86\Release\ 81 | TRACE;NETFX_CORE;WINDOWS_UWP 82 | true 83 | ;2008 84 | pdbonly 85 | x86 86 | false 87 | prompt 88 | true 89 | true 90 | 91 | 92 | PackageReference 93 | 94 | 95 | 96 | App.xaml 97 | 98 | 99 | MainPage.xaml 100 | 101 | 102 | 103 | 104 | 105 | Designer 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | MSBuild:Compile 146 | Designer 147 | 148 | 149 | MSBuild:Compile 150 | Designer 151 | 152 | 153 | 154 | 155 | 6.1.7 156 | 157 | 158 | 3.3.0.912540 159 | 160 | 161 | 162 | 163 | {150e72bd-08e5-48b6-a7de-010ec70b4545} 164 | Plugin.Sensors 165 | 166 | 167 | {7b815c7c-d030-4441-9982-a23e2101fb9f} 168 | Sample 169 | 170 | 171 | 172 | 14.0 173 | 174 | 175 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Foundation; 3 | using UIKit; 4 | using Xamarin.Forms; 5 | 6 | 7 | namespace Sample.iOS 8 | { 9 | [Register("AppDelegate")] 10 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 11 | { 12 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 13 | { 14 | Forms.Init(); 15 | this.LoadApplication(new App()); 16 | 17 | return base.FinishedLaunching(app, options); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 8.0 25 | CFBundleVersion 26 | 1.0 27 | CFBundleIconFiles 28 | 29 | Icon-60@2x 30 | Icon-60@3x 31 | Icon-76 32 | Icon-76@2x 33 | Default 34 | Default@2x 35 | Default-568h@2x 36 | Default-Portrait 37 | Default-Portrait@2x 38 | Icon-Small-40 39 | Icon-Small-40@2x 40 | Icon-Small-40@3x 41 | Icon-Small 42 | Icon-Small@2x 43 | Icon-Small@3x 44 | 45 | UILaunchStoryboardName 46 | LaunchScreen 47 | CFBundleIdentifier 48 | com.acrapps.sensors 49 | CFBundleName 50 | Sensors 51 | CFBundleShortVersionString 52 | 1 53 | NSMotionUsageDescription 54 | Using some motion 55 | 56 | 57 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UIKit; 3 | 4 | 5 | namespace Sample.iOS 6 | { 7 | public class Application 8 | { 9 | static void Main(string[] args) 10 | { 11 | UIApplication.Main(args, null, "AppDelegate"); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Sample.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Sample.iOS")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Default.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Icon-60@2x.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Icon-60@3x.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Icon-76.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Icon-76@2x.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Icon-Small-40.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Icon-Small.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Icon-Small@2x.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/Resources/Icon-Small@3x.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Sample.iOS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | iPhoneSimulator 6 | 8.0.30703 7 | 2.0 8 | {A76015FB-5B2B-40D5-8BDB-50D0E805EE85} 9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Exe 11 | Sample.iOS 12 | Resources 13 | Sample.iOS 14 | 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\iPhoneSimulator\Debug 22 | DEBUG 23 | prompt 24 | 4 25 | false 26 | i386, x86_64 27 | None 28 | true 29 | 30 | 31 | none 32 | true 33 | bin\iPhoneSimulator\Release 34 | prompt 35 | 4 36 | None 37 | i386, x86_64 38 | false 39 | 40 | 41 | true 42 | full 43 | false 44 | bin\iPhone\Debug 45 | DEBUG 46 | prompt 47 | 4 48 | false 49 | ARMv7, ARM64 50 | iPhone Developer 51 | true 52 | Entitlements.plist 53 | 54 | 55 | none 56 | true 57 | bin\iPhone\Release 58 | prompt 59 | 4 60 | ARMv7, ARM64 61 | false 62 | iPhone Developer 63 | Entitlements.plist 64 | 65 | 66 | none 67 | True 68 | bin\iPhone\Ad-Hoc 69 | prompt 70 | 4 71 | False 72 | ARMv7, ARM64 73 | True 74 | Automatic:AdHoc 75 | iPhone Distribution 76 | Entitlements.plist 77 | 78 | 79 | none 80 | True 81 | bin\iPhone\AppStore 82 | prompt 83 | 4 84 | False 85 | ARMv7, ARM64 86 | Automatic:AppStore 87 | iPhone Distribution 88 | Entitlements.plist 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 3.3.0.912540 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | {150e72bd-08e5-48b6-a7de-010ec70b4545} 133 | Plugin.Sensors 134 | 135 | 136 | {7b815c7c-d030-4441-9982-a23e2101fb9f} 137 | Sample 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/iTunesArtwork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/iTunesArtwork -------------------------------------------------------------------------------- /Sample/Sample.iOS/iTunesArtwork@2x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/Sample/Sample.iOS/iTunesArtwork@2x -------------------------------------------------------------------------------- /Sample/Sample/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Sample/Sample/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xamarin.Forms; 3 | using Xamarin.Forms.Xaml; 4 | 5 | 6 | [assembly: XamlCompilation(XamlCompilationOptions.Skip)] 7 | 8 | namespace Sample 9 | { 10 | public partial class App : Application 11 | { 12 | public App() 13 | { 14 | this.InitializeComponent(); 15 | 16 | this.MainPage = new NavigationPage(new MainPage()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Sample/Sample/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Sample/Sample/ISensorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | 4 | 5 | namespace Sample 6 | { 7 | public interface ISensorViewModel 8 | { 9 | string Title { get; } 10 | ICommand Toggle { get; } 11 | string ValueName { get; } 12 | string Value { get; } 13 | string ToggleText { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Sample/Sample/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Sample/Sample/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xamarin.Forms; 3 | 4 | 5 | namespace Sample 6 | { 7 | public partial class MainPage : TabbedPage 8 | { 9 | public MainPage() 10 | { 11 | InitializeComponent(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Sample/Sample/MainViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Reactive.Linq; 5 | using Plugin.Sensors; 6 | using ReactiveUI; 7 | 8 | 9 | namespace Sample 10 | { 11 | public class MainViewModel 12 | { 13 | 14 | public List Sensors { get; } 15 | 16 | 17 | public MainViewModel() 18 | { 19 | this.Sensors = new List 20 | { 21 | new SensorViewModel(CrossSensors.Accelerometer, "G"), 22 | new SensorViewModel(CrossSensors.Gyroscope, "G"), 23 | new SensorViewModel(CrossSensors.Magnetometer, "M"), 24 | new SensorViewModel(CrossSensors.Compass, "D"), 25 | new SensorViewModel(CrossSensors.DeviceOrientation, "Position"), 26 | new SensorViewModel(CrossSensors.AmbientLight, "Light"), 27 | new SensorViewModel(CrossSensors.Barometer, "Pressure"), 28 | new SensorViewModel(CrossSensors.Pedometer, "Steps"), 29 | new SensorViewModel(CrossSensors.Proximity, "Near") 30 | }; 31 | CrossSensors 32 | .MotionActivity 33 | .WhenActivityChanged() 34 | .ObserveOn(RxApp.MainThreadScheduler) 35 | .Subscribe(x => this.MotionActivities.Add(new MotionActivityViewModel 36 | { 37 | Text = $"{x.Motions} ({x.Confidence})", 38 | Detail = x.StartDate.ToString() 39 | })); 40 | } 41 | 42 | 43 | public bool IsMotionActivityAvailable => CrossSensors.MotionActivity.IsSupported; 44 | public ObservableCollection MotionActivities { get; } = new ObservableCollection(); 45 | } 46 | 47 | 48 | public class MotionActivityViewModel 49 | { 50 | public string Text { get; set; } 51 | public string Detail { get; set; } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Sample/Sample/Sample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Sample/Sample/SensorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Reactive.Linq; 4 | using System.Runtime.CompilerServices; 5 | using System.Windows.Input; 6 | using Plugin.Sensors; 7 | using ReactiveUI; 8 | using ReactiveUI.Fody.Helpers; 9 | using Xamarin.Forms; 10 | 11 | 12 | namespace Sample 13 | { 14 | public class SensorViewModel : ReactiveObject, ISensorViewModel 15 | { 16 | IDisposable sensorSub; 17 | 18 | 19 | public SensorViewModel(ISensor sensor, string valueName, string title = null) 20 | { 21 | this.Title = title ?? sensor.GetType().Name.Replace("Impl", String.Empty); 22 | this.ValueName = valueName; 23 | this.ToggleText = sensor.IsAvailable ? "Start" : "Sensor Not Available"; 24 | 25 | this.Toggle = new Command(() => 26 | { 27 | if (!sensor.IsAvailable) 28 | return; 29 | 30 | if (this.sensorSub == null) 31 | { 32 | this.ToggleText = "Stop"; 33 | this.sensorSub = sensor 34 | .WhenReadingTaken() 35 | .Sample(TimeSpan.FromMilliseconds(500)) 36 | .ObserveOn(RxApp.MainThreadScheduler) 37 | .Subscribe(x => this.Value = x.ToString()); 38 | } 39 | else 40 | { 41 | this.ToggleText = "Start"; 42 | this.sensorSub.Dispose(); 43 | this.sensorSub = null; 44 | } 45 | }); 46 | } 47 | 48 | 49 | public string Title { get; } 50 | public ICommand Toggle { get; } 51 | public string ValueName { get; } 52 | [Reactive] public string Value { get; private set; } 53 | [Reactive] public string ToggleText { get; private set; } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # CHANGE LOG 2 | 3 | ## 2.5.0 4 | * Update to System.Reactive 4 5 | * Add SourceLink 6 | 7 | ## 2.4.2 8 | * [fix][ios] Queue is empty when firing from background 9 | * Minor shift of internals 10 | 11 | ## 2.3 12 | * [feature] .NET Standard 2.0 13 | 14 | ## 2.2.1 15 | * [fix] nuget package was missing netstandard library 16 | 17 | ## 2.2.0 18 | * [feature] device orientation 19 | 20 | ## 2.1.0 21 | * [feature][android] compass implementation 22 | * [fix][android] proximity sensor now returns relevant boolean values. Thanks to Emil Aplipiev 23 | * [fix][android] sensors now fire at fastest trigger speed. Use observable.sample(timespan) to make this consumable 24 | * [fix][uwp] barometer was not firing event 25 | * [fix] remove any reference to timers as they are not used 26 | 27 | ## 2.0.1 28 | * [fix][uwp] barometer was not reporting 29 | * remove signatures with report interval since it isn't intended to be used. Use the observable Sample or Buffer 30 | 31 | ## 2.0.0 32 | * [netstandard] this release only changes the bait/switch to netstandard. If you need PCL, use 1.0 33 | 34 | ## 1.0.1 35 | * [uwp] merge in UWP ADXL345 accelerometer sensor 36 | 37 | ## 1.0.0 38 | * Initial Release for iOS, Android, UWP, & WinIot 39 | * Supported Sensors 40 | * Accelerometer 41 | * Ambient Light 42 | * Barometer 43 | * Compass 44 | * Gyroscope 45 | * Magnetometer 46 | * Pedometer 47 | * Proximity -------------------------------------------------------------------------------- /nuget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aritchie/sensors/38e450c05882b7c58f9b28dc7cac5d6797d79f38/nuget.exe -------------------------------------------------------------------------------- /push.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | nuget push .\Plugin.Sensors\bin\Release\*.nupkg -Source https://www.nuget.org/api/v2/package 3 | pause -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # UPDATE - This library has now moved to the Shiny Framework at https://github.com/shinyorg/shiny 2 | 3 | ## ACR Reactive Sensors Plugin for Xamarin & Windows 4 | _Easy to use, cross platform, REACTIVE Sensor Plugin for iOS, Android, and Windows UWP_ 5 | 6 | [Change Log - May 26, 2018](changelog.md) 7 | 8 | [![NuGet](https://img.shields.io/nuget/v/Plugin.Sensors.svg?maxAge=2592000)](https://www.nuget.org/packages/Plugin.Sensors/) 9 | [![Build status](https://dev.azure.com/allanritchie/Plugins/_apis/build/status/Sensors)](https://dev.azure.com/allanritchie/Plugins/_build/latest?definitionId=11) 10 | 11 | 12 | ## PLATFORMS 13 | |Platform|Version| 14 | |--------|-------| 15 | iOS|7+ 16 | Android|4.3+ 17 | Windows UWP (including core)|16299+ 18 | .NET Standard|2.0 19 | 20 | 21 | ## SUPPORTED SENSORS 22 | 23 | * Accelerometer 24 | * Ambient Light 25 | * Barometer 26 | * Compass 27 | * Device Orientation 28 | * Gyroscope 29 | * Magnetometer 30 | * Pedometer 31 | * Proximity 32 | 33 | 34 | ## SETUP 35 | 36 | Be sure to install the Plugin.Sensors nuget package in all of your main platform projects as well as your core/PCL project 37 | 38 | [![NuGet](https://img.shields.io/nuget/v/Plugin.Sensors.svg?maxAge=2592000)](https://www.nuget.org/packages/Plugin.Sensors/) 39 | 40 | ### iOS 41 | 42 | If you plan to use the pedometer on iOS, you need to add the following to your Info.plist 43 | 44 | ```xml 45 | 46 | NSMotionUsageDescription 47 | Using some motion 48 | 49 | ``` 50 | 51 | 52 | ## HOW TO USE BASICS 53 | 54 | ```csharp 55 | 56 | // discover some devices 57 | CrossSensors.Accelerometer 58 | CrossSensors.Gyroscope 59 | CrossSensors.Magnetometer.WhenReadingTaken().Subscribe(reading => {}); 60 | 61 | ``` 62 | --------------------------------------------------------------------------------