Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

Sensors -- Android Step_Counter ?

$
0
0

I have a Delphi Berlin Android application that needs to access the Android Step_Counter. I have researched for a few days and find no Delphi related references or examples for the Android step sensors referenced below.

I could really use some help at this point. Is there any way to access/add support for  the step_counter in Delphi ?

 

Thank you,

Clark

 

 

 

TYPE_STEP_COUNTER

Added in API level 19
int TYPE_STEP_COUNTER

A constant describing a step counter sensor.

A sensor of this type returns the number of steps taken by the user since the last reboot while activated. The value is returned as a float (with the fractional part set to zero) and is reset to zero only on a system reboot. The timestamp of the event is set to the time when the last step for that event was taken. This sensor is implemented in hardware and is expected to be low power. If you want to continuously track the number of steps over a long period of time, do NOT unregister for this sensor, so that it keeps counting steps in the background even when the AP is in suspend mode and report the aggregate count when the AP is awake. Application needs to stay registered for this sensor because step counter does not count steps if it is not activated. This sensor is ideal for fitness tracking applications. It is defined as an REPORTING_MODE_ON_CHANGE sensor.

See SensorEvent.values for more details.

Constant Value: 19 (0x00000013)TYPE_STEP_DETECTOR

Added in API level 19
int TYPE_STEP_DETECTOR

A constant describing a step detector sensor.

A sensor of this type triggers an event each time a step is taken by the user. The only allowed value to return is 1.0 and an event is generated for each step. Like with any other event, the timestamp indicates when the event (here the step) occurred, this corresponds to when the foot hit the ground, generating a high variation in acceleration. This sensor is only for detecting every individual step as soon as it is taken, for example to perform dead reckoning. If you only need aggregate number of steps taken over a period of time, register for TYPE_STEP_COUNTER instead. It is defined as aREPORTING_MODE_SPECIAL_TRIGGER sensor.

See SensorEvent.values for more details.

Constant Value: 18 (0x00000012)


Viewing all articles
Browse latest Browse all 3212

Trending Articles