• Mobile
  • Extensions
  • Releases
  • GitHub
  • Blog
  • Sponsor
Show / Hide Table of Contents
  • Home
  • Quick Start
  • Setup
    • Dependency Injection
    • Startup
    • Static Instances
    • iOS
    • Android
  • Configuration Extensions
  • Jobs
    • Setup
    • Create a Job
    • Querying, Cancelling, and Adhoc
    • Frequently Asked Questions
  • Bluetooth LE Client
    • Setup
    • Scanning
    • Peripheral
    • Best Practices
    • Manged Scanning
    • Managed Peripheral
  • Bluetooth LE Hosting
    • Setup
    • GATT
    • Advertising
  • Geofencing
  • GPS
    • Setup
  • Motion Activity
  • Local Notifications
    • Getting Started
    • Channels
  • Push Notifications
    • Getting Started
    • Native
    • Azure Notification Hubs
    • Firebase Messaging
    • One Signal
  • Beacons
    • Ranging
    • Monitoring (Background)
  • HTTP Transfers
    • Getting Started
    • Advanced
  • Framework
    • Getting Started
    • ViewModel
  • Sensors
    • Getting Started
    • Accelerometer
    • Ambient Light
    • Barometer
    • Compass
    • Gyroscope
    • Humidity
    • Magnetometer
    • Pedometer
    • Proximity
    • Temperature

SETUP

  1. Be sure to install the Shiny.Sensors nuget package in your shared code project NuGet

  2. To use each type of sensor, use the following in your ShinyStartup:

using Shiny;
using Microsoft.Extensions.DependencyInjection;

namespace YourNamespace
{
    public class YourStartup : ShinyStarup
    {
        services.UseAccelerometer();
        services.UseAmbientLightSensor();
        services.UseBarometer();
        services.UseCompass();
        services.UseMagnetometer();
        services.UsePedometer();
        services.UseProximitySensor();
        services.UseHeartRateMonitor();
        services.UseTemperature();
        services.UseHumidity(); 
    }
}

NOTE: each Use returns a boolean as to whether or not it is supported. You can use optional dependencies (ie. IDependency dep = null) in your viewmodels/services then check for null to see if the sensor is available on the device.

  • Improve this Doc
In This Article
Back to top Generated by DocFX