Essentials: Step Counter API

Created on 9 Jul 2018  路  4Comments  路  Source: xamarin/Essentials

Description

Implements an API that allows to interact with integrated Step Counter when available in order to have:

  • number of steps taken by the user since the last reboot while the sensor was activated

API

public class StepCounter
{
    bool IsMonitoring { get; private set; }
    void Start();
    void Stop();
    event StepCounterChangedEventHandler ReadingChanged;
}

Struct StepCounterChangedEventHandler

    public class StepCounterChangedEventHandler : EventArgs
    {
        DateTimeOffset Timestamp {get; private set}; // time of the most recent pedometer reading
        int TotalSteps {get; private set}; 
    }

Implementation

VS bug #735664

feature-request needs-more-discussion proposal

Most helpful comment

It would be great if Xamarin.Essentials has all sensors built-in, especially the pedometer.

All 4 comments

Considerations here is that they would be only when the app is open and is not for background tracking. On Android that would require a service.

@jamesmontemagno Any updates on this feature request(background tracking)

It will be great if you link it to the Location API in Xamarin Essentials to return the current location too

It would be great if Xamarin.Essentials has all sensors built-in, especially the pedometer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TedMobile picture TedMobile  路  3Comments

Tommigun1980 picture Tommigun1980  路  3Comments

charlespetzold picture charlespetzold  路  4Comments

Howell1618 picture Howell1618  路  4Comments

gabry90 picture gabry90  路  3Comments