public class OrientationManager extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
OrientationManager.OnChangedListener
Classes should implement this interface if they want to be notified of changes in the user's
location, orientation, or the accuracy of the compass.
|
Constructor and Description |
---|
OrientationManager(android.hardware.SensorManager sensorManager,
android.location.LocationManager locationManager)
Initializes a new instance of
OrientationManager , using the specified context to
access system services. |
Modifier and Type | Method and Description |
---|---|
void |
addOnChangedListener(OrientationManager.OnChangedListener listener)
Adds a listener that will be notified when the user's location or orientation changes.
|
float |
getHeading()
Gets the user's current heading, in degrees.
|
android.location.Location |
getLocation()
Gets the user's current location.
|
float |
getPitch()
Gets the user's current pitch (head tilt angle), in degrees.
|
boolean |
hasInterference()
Gets a value indicating whether there is too much magnetic field interference for the
compass to be reliable.
|
boolean |
hasLocation()
Gets a value indicating whether the orientation manager knows the user's current location.
|
void |
removeOnChangedListener(OrientationManager.OnChangedListener listener)
Removes a listener from the list of those that will be notified when the user's location or
orientation changes.
|
void |
start()
Starts tracking the user's location and orientation.
|
void |
stop()
Stops tracking the user's location and orientation.
|
public OrientationManager(android.hardware.SensorManager sensorManager, android.location.LocationManager locationManager)
OrientationManager
, using the specified context to
access system services.public void addOnChangedListener(OrientationManager.OnChangedListener listener)
public void removeOnChangedListener(OrientationManager.OnChangedListener listener)
public void start()
OrientationManager.OnChangedListener
s added to this object will be notified of these events.public void stop()
public boolean hasInterference()
public boolean hasLocation()
public float getHeading()
public float getPitch()
public android.location.Location getLocation()
Copyright © 2014. All rights reserved.