|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.system.AccelerometerChannelConfig
public class AccelerometerChannelConfig
Accelerometer channel configuration. Contains data type, application running mode and raw samples count to keep in buffer.
Field Summary | ||
---|---|---|
static int |
TYPE_ORIENTATION
Channel type for orientation values. |
|
static int |
TYPE_RAW
Channel type for raw acceleration values. |
Constructor Summary | ||
---|---|---|
AccelerometerChannelConfig(int types)
Creates channel configuration for given data types. |
||
AccelerometerChannelConfig(int types,
boolean foregroundMode,
boolean backgroundMode,
int samplesCount)
Creates channel configuration based on data types, application running mode and raw samples count. |
Method Summary | ||
---|---|---|
int |
getSamplesCount()
Returns number of raw samples to store in channel buffer |
|
int |
getTypes()
Returns channel types |
|
boolean |
isBackgroundMode()
Returns whether channel should be active for application in background mode |
|
boolean |
isForegroundMode()
Returns whether channel should be active for application in foreground mode |
|
void |
setBackgroundMode(boolean backgroundMode)
Sets whether channel should be active for application in background mode |
|
void |
setForegroundMode(boolean foregroundMode)
Sets whether channel should be active for application in foreground mode |
|
void |
setSamplesCount(int samplesCount)
Sets number of raw samples to keep in a buffer. |
|
void |
setTypes(int types)
Sets channel types |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_RAW
public static final int TYPE_ORIENTATION
Constructor Detail |
---|
public AccelerometerChannelConfig(int types)
types
- mask with type flagspublic AccelerometerChannelConfig(int types, boolean foregroundMode, boolean backgroundMode, int samplesCount)
If application needs data only when running in the foreground then it should specify false for background mode as it will turn off accelerometer sensor query routine when unnecessary.
types
- a mask of AccelerometerChannelConfig.TYPE_ORIENTATION
and AccelerometerChannelConfig.TYPE_RAW
values which specify required data typeforegroundMode
- if true then the channel is active when application is in
foreground mode, if false then the sensor is not queried
to save powerbackgroundMode
- if true then the channel is active when application is in
background mode, if false then the sensor is not queried
to save powersamplesCount
- number of raw samples to keep in bufferMethod Detail |
---|
public int getTypes()
public void setTypes(int types)
types
- as maskpublic boolean isForegroundMode()
public void setForegroundMode(boolean foregroundMode)
foregroundMode
- specifies new foreground modepublic boolean isBackgroundMode()
public void setBackgroundMode(boolean backgroundMode)
backgroundMode
- specifies new background modepublic int getSamplesCount()
public void setSamplesCount(int samplesCount)
samplesCount
- number of samples to keep in buffer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal