public static class SmotionPedometer.Info
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
COUNT_RUN_DOWN
Pedometer count for running downhill.
|
static int |
COUNT_RUN_FLAT
Pedometer count for running on a flat surface.
|
static int |
COUNT_RUN_UP
Pedometer count for running uphill.
|
static int |
COUNT_TOTAL
Total pedometer count, which is the sum of the walk and run counts.
|
static int |
COUNT_WALK_DOWN
Pedometer count for walking downhill.
|
static int |
COUNT_WALK_FLAT
Pedometer count for walking on a flat surface.
|
static int |
COUNT_WALK_UP
Pedometer count for walking uphill.
|
static int |
STATUS_RUN_DOWN
Running downhill.
|
static int |
STATUS_RUN_FLAT
Running on a flat surface.
|
static int |
STATUS_RUN_UP
Running uphill.
|
static int |
STATUS_STOP
Not moving.
|
static int |
STATUS_UNKNOWN
Unknown status.
|
static int |
STATUS_WALK_DOWN
Walking downhill.
|
static int |
STATUS_WALK_FLAT
Walking on a flat surface.
|
static int |
STATUS_WALK_UP
Walking uphill.
|
Constructor and Description |
---|
SmotionPedometer.Info()
Creates a SmotionPedometer.Info instance.
|
Modifier and Type | Method and Description |
---|---|
double |
getCalorie()
Get the cumulative calories consumed since the last reboot when at
least one listener is added.
|
long |
getCount(int type)
Get the cumulative step count by type since the last reboot when at
least one listener is added.
|
double |
getDistance()
Get the cumulative distance traveled since the last reboot when at
least one listener is added.
|
double |
getSpeed()
Get the step speed.
|
int |
getStatus()
Get the step status.
|
long |
getTimeStamp()
Get the timestamp in nanoseconds.
|
public static final int STATUS_UNKNOWN
public static final int STATUS_STOP
public static final int STATUS_WALK_UP
public static final int STATUS_WALK_DOWN
public static final int STATUS_WALK_FLAT
public static final int STATUS_RUN_UP
public static final int STATUS_RUN_DOWN
public static final int STATUS_RUN_FLAT
public static final int COUNT_TOTAL
public static final int COUNT_WALK_UP
public static final int COUNT_WALK_DOWN
public static final int COUNT_WALK_FLAT
public static final int COUNT_RUN_UP
public static final int COUNT_RUN_DOWN
public static final int COUNT_RUN_FLAT
public SmotionPedometer.Info()
java.lang.IllegalStateException
- Thrown if the device does not support
SmotionPedometer or the SmotionPedometer instance is not
created.public long getTimeStamp()
public double getSpeed()
public double getDistance()
public double getCalorie()
public int getStatus()
public long getCount(int type)
type
- The count type you want to retrieve.The valid values are:
COUNT_RUN_DOWN COUNT_RUN_FLAT
COUNT_RUN_UP COUNT_STOP COUNT_WALK_DOWN
COUNT_WALK_FLAT COUNT_WALK_UPjava.lang.IllegalArgumentException
- Thrown if the type passed is not
valid.