|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.system.MagnetometerChannelConfig
public final class MagnetometerChannelConfig
Provides functionality for configuring the magnetometer channel.
| Constructor Summary | ||
|---|---|---|
MagnetometerChannelConfig()
Constructs the default configuration for the magnetometer sensor. |
||
MagnetometerChannelConfig(int freq)
Configures the magnetometer sensor with the specified options. |
||
MagnetometerChannelConfig(int freq,
boolean foregroundMode,
boolean backgroundMode)
Configures the magnetometer sensor with the specified options. |
||
| Method Summary | ||
|---|---|---|
int |
getFrequency()
Retrieves the frequency. |
|
boolean |
isBackgroundMode()
Indicates whether the channel should be active for the application that is in the background. |
|
boolean |
isForegroundMode()
Indicates whether the channel should be active for the application that is in the foreground. |
|
void |
setBackgroundMode(boolean backgroundMode)
Specifies that the channel should be active for the application that is in the background. |
|
void |
setForegroundMode(boolean foregroundMode)
Specifies that the channel should be active for the application that is in the foreground. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MagnetometerChannelConfig()
This configuration is equivalent to MagnetometerChannelConfig( 10, true, false ).
It sets the magnetometer sensor to receive updates at a frequency of 10 Hz (100ms), and the sensor is active only
when the application opening the channel is in the foreground.
public MagnetometerChannelConfig(int freq)
freq - The sampling frequency (in Hz). If this value is smaller or
larger than what is supported by the hardware, the minimum
or maximum value is selected.
This configuration is equivalent to MagnetometerChannelConfig( freq, true, false ).
It sets the magnetometer sensor to receive updates at the specified frequency, and the sensor is active only
when the application opening the channel is in the foreground.
public MagnetometerChannelConfig(int freq,
boolean foregroundMode,
boolean backgroundMode)
freq - The sampling frequency (in Hz). If this value is smaller or
larger than what is supported by the hardware, the minimum
or maximum value is selected.foregroundMode - If true the magnetometer is active when the owning application
is in the foreground, if false the magnetometer is not active.backgroundMode - If true the magnetometer is active when the owning application
is in the background, if false the magnetometer is not active.
The device battery lasts substantially longer if the magnetometer sensor is turned off while
your application is in the background.| Method Detail |
|---|
public int getFrequency()
public boolean isForegroundMode()
true if the channel should be opened in the foreground,
false otherwise.public void setForegroundMode(boolean foregroundMode)
foregroundMode - true to specify a new foreground mode,
false otherwise.public boolean isBackgroundMode()
true if the channel should be opened in the background,
false otherwise.public void setBackgroundMode(boolean backgroundMode)
backgroundMode - true to specify a new background mode,
false otherwise.
|
|||||||||
| 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