Android Open Source - android-compass Global Data






From Project

Back to project page android-compass.

License

The source code is released under:

Apache License

If you think the Android project android-compass listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.jwetherell.compass.data;
/*from w ww .ja va2s.co m*/
/**
 * Abstract class which should be used to set global data.
 * 
 * @author Justin Wetherell <phishman3579@gmail.com>
 */
public abstract class GlobalData {

    private static final Object lock = new Object();
    private static float bearing = 0;

    /**
     * Set the bearing.
     * 
     * @param bearing
     *            int representing the current bearing.
     */
    public static void setBearing(float bearing) {
        synchronized (lock) {
            GlobalData.bearing = bearing;
        }
    }

    /**
     * Get the bearing.
     * 
     * @return int representing the bearing.
     */
    public static float getBearing() {
        synchronized (lock) {
            return bearing;
        }
    }
}




Java Source Code List

com.jwetherell.compass.AndroidCompassActivity.java
com.jwetherell.compass.CompassView.java
com.jwetherell.compass.SensorsActivity.java
com.jwetherell.compass.common.LowPassFilter.java
com.jwetherell.compass.data.GlobalData.java