
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
cap-android-steps
Advanced tools
cap-android-steps
Capacitor plugin for counting steps on Android devices using the Android ACTIVITY_RECOGNITION permission or sensor. This plugin can function independently without requiring Health Connect.
npm install cap-android-steps
npx cap sync
Ensure your app has the ACTIVITY_RECOGNITION permission in your AndroidManifest.xml for Android 10+ devices.
No configuration required for this plugin.
TBD
import { CapAndroidSteps } from 'cap-android-steps';
const requestPermission = async () => {
const result = await CapAndroidSteps.requestActivityRecognitionPermission();
return result.granted;
};
const getStepsForPeriod = async (period: 'all') => {
const result = await CapAndroidSteps.getStepsForPeriod({ period });
return result.count;
};
const getRawSensorValues = async () => {
const result = await CapAndroidSteps.getRawSensorValues();
return result;
};
invertString(...)requestActivityRecognitionPermission()getStepsForPeriod(...)getRawSensorValues()invertString(options: InvertStringOptions) => Promise<InvertStringResult>
Inverts the provided string (reverses it). This method has nothing to do with screen orientation.
| Param | Type |
|---|---|
options | InvertStringOptions |
Returns: Promise<InvertStringResult>
requestActivityRecognitionPermission() => Promise<PermissionResult>
Requests the ACTIVITY_RECOGNITION permission on Android 10+ devices. This permission is required for step counting functionality.
Returns: Promise<PermissionResult>
getStepsForPeriod(options?: StepPeriodOptions | undefined) => Promise<StepCountResult>
Gets the step count for a specified period. Requires activity recognition permission on Android 10+.
| Param | Type |
|---|---|
options | StepPeriodOptions |
Returns: Promise<StepCountResult>
getRawSensorValues() => Promise<SensorValuesResult>
Gets the raw sensor values from the step counter sensor. Requires activity recognition permission on Android 10+.
Returns: Promise<SensorValuesResult>
| Prop | Type | Description |
|---|---|---|
value | string | The inverted string. |
| Prop | Type | Description |
|---|---|---|
value | string | The string to invert. |
| Prop | Type | Description |
|---|---|---|
granted | boolean | Whether the permission was granted. |
| Prop | Type | Description |
|---|---|---|
count | number | The number of steps counted during the specified period. |
period | 'hour' | 'day' | 'all' | The period for which the step count was calculated. |
startTime | number | null | The start time of the period in milliseconds. For 'all' period, this is the device boot time. |
endTime | number | The end time of the period in milliseconds (current time). |
| Prop | Type | Description |
|---|---|---|
period | 'hour' | 'day' | 'all' | The period for which to get step data. Valid values are "hour", "day", or "all". - "hour": Steps taken in the last hour - "day": Steps taken in the last 24 hours - "all": All steps recorded since device boot (raw step counter value) Defaults to "day" if not specified. |
| Prop | Type | Description |
|---|---|---|
values | Record<string, number> | Object containing the raw sensor values. The step counter sensor typically only has one value at index "0", but this provides access to all values the sensor might report. |
stepCount | number | The step count value (same as values["0"] for convenience). |
sensorName | string | The name of the step counter sensor. |
sensorVendor | string | The vendor of the step counter sensor. |
sensorVersion | number | The version of the step counter sensor. |
Construct a type with a set of properties K of type T
{
[P in K]: T;
}
See LICENSE.
FAQs
Capacitor plugin for tracking steps on Android devices.
The npm package cap-android-steps receives a total of 1 weekly downloads. As such, cap-android-steps popularity was classified as not popular.
We found that cap-android-steps demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.