java类android.hardware.GeomagneticField的实例源码

QtLocation.java 文件源码 项目:uds 阅读 30 收藏 0 点赞 0 评论 0
public void onLocationChanged(Location location)
{
    // TODO Auto-generated method stub
    double[] getData=new double[8];
    GeomagneticField geomagneticField = new GeomagneticField((float)location.getLatitude(),
            (float)location.getLongitude(), (float)location.getAltitude(),location.getTime());

    getData[0]=location.getLatitude();
    getData[1]=location.getLongitude();
    getData[2]=location.getAltitude();
    getData[3]=location.getTime();
    //these are for attributes
    getData[4]=location.getBearing();//bearing
    getData[5]=location.getSpeed();//ground speed
    getData[6]=geomagneticField.getDeclination();//magnetic dip
    getData[7]=location.getAccuracy();//vertical and horizontal accuracy

    locationDataUpdated(getData,location.getProvider());
}
Sensors.java 文件源码 项目:Multiwii-Remote 阅读 31 收藏 0 点赞 0 评论 0
@Override
public void onLocationChanged(Location location) {

    oldLocation = this.location;
    this.location = location;

    PhoneLatitude = location.getLatitude();
    PhoneLongitude = location.getLongitude();
    PhoneAltitude = location.getAltitude();
    PhoneSpeed = location.getSpeed() * 100f;
    PhoneAccuracy = location.getAccuracy() * 100f;

    //MapCurrentPosition = new LatLng(location.getLatitude(), location.getLongitude());

    geoField = new GeomagneticField(Double.valueOf(location.getLatitude()).floatValue(), Double.valueOf(location.getLongitude()).floatValue(), Double.valueOf(location.getAltitude()).floatValue(), System.currentTimeMillis());
    Declination = geoField.getDeclination();

    if (mGPSListener != null)
        mGPSListener.onSensorsStateGPSLocationChange();
}
WatchService.java 文件源码 项目:pebble-navigation 阅读 27 收藏 0 点赞 0 评论 0
void locationUpdate(Location currentLocation){

        if(!currentLocation.getProvider().equals("gps")) return;

        // calculate declination at this point. This is done only once as it shouldn't change so much at similar location on earth ;)
        //only run this if first time!
        if (declination > 999){
            GeomagneticField geomagneticField = new GeomagneticField((float)currentLocation.getLatitude(),
                (float)currentLocation.getLongitude(), (float)currentLocation.getAltitude(),currentLocation.getTime());
            declination = geomagneticField.getDeclination();
        }
        float distance = currentLocation.distanceTo(geocacheLocation);
        float deviceBearing = currentLocation.getBearing();
        float azimuth = currentLocation.bearingTo(geocacheLocation);
        if(azimuth < 0) azimuth = 360 + azimuth;
        if(deviceBearing < 0) deviceBearing = 360 + deviceBearing;

        float bearing = azimuth - deviceBearing;
        if(bearing < 0) bearing = 360 + bearing;

        updateWatchWithLocation(distance, bearing, azimuth);

    }
LocationUtils.java 文件源码 项目:Forage 阅读 31 收藏 0 点赞 0 评论 0
/**
 * Gets the magnetic declination at the specified location.
 *
 * @param location Current location.
 * @return The declination of the horizontal component of the magnetic
 * field from true north, in degrees (i.e. positive means the
 * magnetic field is rotated east that much from true north).
 */
public static double getMagneticDeclination(@NonNull Location location) {
    GeomagneticField geoField = new GeomagneticField(
            (float) location.getLatitude(),
            (float) location.getLongitude(),
            (float) location.getAltitude(),
            System.currentTimeMillis()
    );

    return geoField.getDeclination();
}
CompassAssistant.java 文件源码 项目:Simple-Android-Compass-Assistant 阅读 20 收藏 0 点赞 0 评论 0
/**
 * initializes a CompassAssistant with a context and a Location. If you use this constructor the
 * resulting degrees will be calculated with the declination for the given location. The compass
 * will point to the geographic north.
 * @param context the context
 * @param l the location to which the CompassAssistant should refer its pointing.
 */
public CompassAssistant(final Context context, Location l) {
    this.context = context;

    if (l != null) {
        GeomagneticField geomagneticField = new GeomagneticField((float)l.getLatitude(),
                (float)l.getLongitude(), (float)l.getAltitude(), new Date().getTime());
        declination = geomagneticField.getDeclination();
    }

    sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
    accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
    magnetometer = sensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);

}
QtLocation.java 文件源码 项目:uds 阅读 25 收藏 0 点赞 0 评论 0
public double[] lastKnownPosition(int fromSatellitePositioningMethodsOnly)
{
    double[] getData=new double[7];
    Location location=null;
    Location networkLastLocation=null;
    Location gpsLastLocation=null;
    try
    {
        networkLastLocation=m_locationManager.getLastKnownLocation(GPS);
        gpsLastLocation=m_locationManager.getLastKnownLocation(NETWORK);
        if(fromSatellitePositioningMethodsOnly == 1)
        {
            location=gpsLastLocation;
        }
        else
        {
            location=(networkLastLocation.getTime()>gpsLastLocation.getTime())
                                                ?networkLastLocation:gpsLastLocation;
        }

        GeomagneticField geomagneticField = new GeomagneticField((float)location.getLatitude(),
                (float)location.getLongitude(), (float)location.getAltitude(),location.getTime());

        getData[0]=location.getAltitude();
        getData[1]=location.getLatitude();
        getData[2]=location.getLongitude();
        getData[3]=location.getTime();
        getData[4]=geomagneticField.getDeclination();
        getData[5]=location.getSpeed();
        getData[6]=location.getBearing();
    }
    catch(Exception e)
    {
        Log.i("QtLocation","LastknownLocation not available");
    }

    return getData;
}
LocationInformation.java 文件源码 项目:trekarta 阅读 21 收藏 0 点赞 0 评论 0
private void updateLocation(double latitude, double longitude, int zoom) {
    mLatitude = latitude;
    mLongitude = longitude;
    mZoom = zoom;

    mCoordinateDegree.setText(StringFormatter.coordinates(0, " ", latitude, longitude));
    mCoordinateDegMin.setText(StringFormatter.coordinates(1, " ", latitude, longitude));
    mCoordinateDegMinSec.setText(StringFormatter.coordinates(2, " ", latitude, longitude));
    mCoordinateUtmUps.setText(StringFormatter.coordinates(3, " ", latitude, longitude));
    mCoordinateMgrs.setText(StringFormatter.coordinates(4, " ", latitude, longitude));

    if (BuildConfig.FULL_VERSION) {
        mSunriseSunset.setLocation(latitude, longitude);
        double sunrise = mSunriseSunset.compute(true);
        double sunset = mSunriseSunset.compute(false);

        if (sunrise == Double.MAX_VALUE || sunset == Double.MAX_VALUE) {
            mSunrise.setText(R.string.never_rises);
            mSunsetTitle.setVisibility(View.GONE);
            mSunset.setVisibility(View.GONE);
        } else if (sunrise == Double.MIN_VALUE || sunset == Double.MIN_VALUE) {
            mSunset.setText(R.string.never_sets);
            mSunriseTitle.setVisibility(View.GONE);
            mSunrise.setVisibility(View.GONE);
        } else {
            mSunrise.setText(mSunriseSunset.formatTime(sunrise));
            mSunset.setText(mSunriseSunset.formatTime(sunset));
            mSunriseTitle.setVisibility(View.VISIBLE);
            mSunrise.setVisibility(View.VISIBLE);
            mSunsetTitle.setVisibility(View.VISIBLE);
            mSunset.setVisibility(View.VISIBLE);
        }

        mOffset.setText(StringFormatter.timeO((int) (mSunriseSunset.getUtcOffset() * 60)));

        GeomagneticField mag = new GeomagneticField((float) latitude, (float) longitude, 0.0f, System.currentTimeMillis());
        mDeclination.setText(String.format(Locale.getDefault(), "%+.1f\u00B0", mag.getDeclination()));
    }
}
RealMagneticDeclinationCalculator.java 文件源码 项目:stardroid 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Sets the user's current location and time.
 */
@Override
public void setLocationAndTime(LatLong location, long timeInMillis) {
  geomagneticField = new GeomagneticField(location.getLatitude(),
          location.getLongitude(),
                                          0,
                                          timeInMillis);
}
CompassFragment.java 文件源码 项目:android_maplibui 阅读 30 收藏 0 点赞 0 评论 0
public static float getDeclination(Location location, long timestamp) {
    if (location == null)
        return 0;

    GeomagneticField field = new GeomagneticField((float) location.getLatitude(), (float) location.getLongitude(),
            (float) location.getAltitude(), timestamp);

    return field.getDeclination();
}
BearingToNorthProvider.java 文件源码 项目:bearing-example 阅读 25 收藏 0 点赞 0 评论 0
private GeomagneticField getGeomagneticField(Location location)
{
    GeomagneticField geomagneticField = new GeomagneticField(
            (float)location.getLatitude(),
            (float)location.getLongitude(),
            (float)location.getAltitude(),
            System.currentTimeMillis());
    return geomagneticField;
}
LocationMgrImpl.java 文件源码 项目:Artoria 阅读 23 收藏 0 点赞 0 评论 0
public GeomagneticField getGeomagneticField() {
    Location location = getCurrentLocation();
    GeomagneticField gmf = new GeomagneticField(
            (float) location.getLatitude(),
            (float) location.getLongitude(),
            (float) location.getAltitude(), System.currentTimeMillis());
    return gmf;
}
SampleHeadingCompassUp.java 文件源码 项目:osmdroid 阅读 20 收藏 0 点赞 0 评论 0
@Override
public void onOrientationChanged(final float orientationToMagneticNorth, IOrientationProvider source) {
    //note, on devices without a compass this never fires...

    //only use the compass bit if we aren't moving, since gps is more accurate when we are moving
    if (gpsspeed < 0.01) {
        GeomagneticField gf = new GeomagneticField(lat, lon, alt, timeOfFix);
        trueNorth = orientationToMagneticNorth + gf.getDeclination();
        gf = null;
        synchronized (trueNorth) {
            if (trueNorth > 360.0f) {
                trueNorth = trueNorth - 360.0f;
            }
            float actualHeading = 0f;

            //this part adjusts the desired map rotation based on device orientation and compass heading
            float t = (360 - trueNorth - this.deviceOrientation);
            if (t < 0) {
                t += 360;
            }
            if (t > 360) {
                t -= 360;
            }
            actualHeading = t;
            //help smooth everything out
            t = (int) t;
            t = t / 5;
            t = (int) t;
            t = t * 5;
            mMapView.setMapOrientation(t);
            updateDisplay(actualHeading,false);
        }
    }
}
OsmAndLocationProvider.java 文件源码 项目:osmLib 阅读 26 收藏 0 点赞 0 评论 0
private float calcGeoMagneticCorrection(float val) {
    if (previousCorrectionValue == 360 && getLastKnownLocation() != null) {
        OsmLocation l = getLastKnownLocation();
        GeomagneticField gf = new GeomagneticField((float) l.getLatitude(), (float) l.getLongitude(), (float) l.getAltitude(),
                System.currentTimeMillis());
        previousCorrectionValue = gf.getDeclination();
    }
    if (previousCorrectionValue != 360) {
        val += previousCorrectionValue;
    }
    return val;
}
CompassFragment.java 文件源码 项目:fire_reporter 阅读 32 收藏 0 点赞 0 评论 0
public static float getDeclination(Location location, long timestamp) {
    if(location == null)
        return 0;
    GeomagneticField field = new GeomagneticField((float) location.getLatitude(), (float) location.getLongitude(),
            (float) location.getAltitude(), timestamp);

    return field.getDeclination();
}
Androzic.java 文件源码 项目:Androzic 阅读 20 收藏 0 点赞 0 评论 0
@Override
public void onLocationChanged(final Location location, final boolean continous, final boolean geoid, final float smoothspeed, final float avgspeed)
{
    Log.d(TAG, "Location arrived");

    final long lastLocationMillis = location.getTime();

    if (angleMagnetic && lastLocationMillis - lastMagnetic >= magInterval)
    {
        GeomagneticField mag = new GeomagneticField((float) location.getLatitude(), (float) location.getLongitude(), (float) location.getAltitude(), System.currentTimeMillis());
        magneticDeclination = mag.getDeclination();
        lastMagnetic = lastLocationMillis;
    }

    Androzic.this.location[0] = location.getLatitude();
    Androzic.this.location[1] = location.getLongitude();

    shouldEnableFollowing = shouldEnableFollowing || lastKnownLocation == null;

    lastKnownLocation = location;
    gpsEnabled = gpsEnabled || LocationManager.GPS_PROVIDER.equals(location.getProvider());
    gpsContinous = continous;
    gpsGeoid = geoid;

    if (overlayManager.accuracyOverlay != null && location.hasAccuracy())
    {
        overlayManager.accuracyOverlay.setAccuracy(location.getAccuracy());
    }
}
CompassFragment.java 文件源码 项目:nextgismobile_old 阅读 36 收藏 0 点赞 0 评论 0
public static float getDeclination(Location location, long timestamp) {

        if(location == null){
            return 0;
        }
        GeomagneticField field = new GeomagneticField((float) location.getLatitude(), (float) location.getLongitude(),
                (float) location.getAltitude(), timestamp);

        return field.getDeclination();
    }
LocationMgrImpl.java 文件源码 项目:ARKOST 阅读 24 收藏 0 点赞 0 评论 0
public GeomagneticField getGeomagneticField() {
    Location location = getCurrentLocation();
    GeomagneticField gmf = new GeomagneticField(
            (float) location.getLatitude(),
            (float) location.getLongitude(),
            (float) location.getAltitude(), System.currentTimeMillis());
    return gmf;
}
SensorsActivity.java 文件源码 项目:android-compass 阅读 20 收藏 0 点赞 0 评论 0
/**
 * {@inheritDoc}
 */
@Override
public void onLocationChanged(Location location) {
    if (location == null) throw new NullPointerException();
    currentLocation = (location);
    gmf = new GeomagneticField((float) currentLocation.getLatitude(), (float) currentLocation.getLongitude(), (float) currentLocation.getAltitude(),
            System.currentTimeMillis());
}
Route.java 文件源码 项目:GPSTracker 阅读 40 收藏 0 点赞 0 评论 0
@Override
    public void onSensorChanged(SensorEvent event) {

    // get the angle around the z-axis rotated
        if (event.sensor == mMagneticSensor) {
            System.arraycopy(event.values, 0, mLastMagnetometer, 0, event.values.length);
            mLastMagnetometerSet = true;
        } else if (event.sensor == mAccelerometer) {
            System.arraycopy(event.values, 0, mLastAccelerometer, 0, event.values.length);
            mLastAccelerometerSet = true;
        }

        if (mLastAccelerometerSet && mLastMagnetometerSet) {
            SensorManager.getRotationMatrix(mR, null, mLastAccelerometer, mLastMagnetometer);
            SensorManager.getOrientation(mR, mOrientation);
            float azimuthInRadians = mOrientation[0];

            float azimuthInDegress = (float) (Math.toDegrees(azimuthInRadians) + 360) % 360;

            mTargetDirection = azimuthInDegress;
        }

        float azimuth = -mTargetDirection;
        GeomagneticField geoField = new GeomagneticField( Double
                .valueOf( mLastLocation.getLatitude() ).floatValue(), Double
                .valueOf( mLastLocation.getLongitude() ).floatValue(),
                Double.valueOf( mLastLocation.getAltitude() ).floatValue(),
                System.currentTimeMillis() );
        if(geoField.getDeclination()<0) {
            azimuth += geoField.getDeclination(); // converts magnetic north into true north
        }else{
            azimuth -= geoField.getDeclination();
        }
        //Correct the azimuth
        azimuth = (azimuth+360) % 360;
        //get the bearing
        float y = (float)Math.sin(Math.toRadians(target.getLongitude()-mLastLocation.getLongitude())) * (float)Math.cos(Math.toRadians(target.getLatitude()));
        float x = (float)Math.cos(Math.toRadians(mLastLocation.getLatitude()))*(float)Math.sin(Math.toRadians(target.getLatitude())) -
                (float)Math.sin(Math.toRadians(mLastLocation.getLatitude()))*(float)Math.cos(Math.toRadians(target.getLatitude()))*(float)Math.cos(Math.toRadians(target.getLongitude()-mLastLocation.getLongitude()));
        float bearing = (float)Math.toDegrees(Math.atan2(y, x));
    image.setRotation(azimuth+bearing);
}
NavigationService.java 文件源码 项目:corsaire 阅读 27 收藏 0 点赞 0 评论 0
@Override
public void onLocationChanged(Location location) {
    Log.i(TAG, "position gps accuracy : " + location.getAccuracy());
    if (location.getAccuracy() > 30) {
        return;
    }
    this.location = location;
    Log.i(TAG, "locationChanged");
    Log.i(TAG, "distance jusqu'au prochain : " + location.distanceTo(current.end));
    Step old = current;
    current = getCurrentPoint(location);

    distance = Math.round(location.distanceTo(current.end));
    //Orientation

    GeomagneticField field = new GeomagneticField(
            (float) location.getLatitude(),
            (float) location.getLongitude(),
            (float) location.getAltitude(),
            System.currentTimeMillis()
    );

    // getDeclination returns degrees
    mDeclination = field.getDeclination();


    double lat1 = location.getLatitude();
    double lng1 = location.getLongitude();

    double lat2 = current.end.getLatitude();
    double lng2 = current.end.getLongitude();

    double dLon = (lng2 - lng1);
    double y = Math.sin(dLon) * Math.cos(lat2);
    double x = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(dLon);
    angle = Math.toDegrees((Math.atan2(y, x)));


    Calendar before = Calendar.getInstance();
    before.add(Calendar.SECOND, -40);
    if (!current.equals(old) || firstime) {
        showDirection(old);
        //showDirection();
        firstime = false;
        lastShowDirection = location;
        if(!firstime && sharedPref.getBoolean(getString(R.string.pref_vibrate_key),false) && vibrator != null){
            vibrator.vibrate(500);
        }
    } else if (lastShowDirection.distanceTo(location)>50 && (!(current instanceof TransitStep) || current.end.distanceTo(location)<100)) {
        showDirection();
        lastShowDirection = location;
    } else if (!this.arrived && current.equals(itinerary.steps.getLast()) && current.end.distanceTo(location) < 10){
        //Arrivée à destination
        this.arrived = true;
        showDirection(old);
    }
    send(UPDATE_CODE, new Bundle());

}
LocationTracker.java 文件源码 项目:custom-maps 阅读 20 收藏 0 点赞 0 评论 0
@Override
public void onLocationChanged(Location location) {
  if (location == null || isQuitting) {
    return;
  }

  long now = System.currentTimeMillis();
  if (currentLocation != null) {
    // Never overwrite recent GPS location with a NETWORK location
    if (location.getProvider().equals(LocationManager.NETWORK_PROVIDER) &&
        currentLocation.getProvider().equals(LocationManager.GPS_PROVIDER) &&
        now < lastGpsTime + GPS_EXPIRATION) {
      return;
    }
    // Ignore updates that come out of order from the same location provider
    if (location.getProvider().equals(currentLocation.getProvider()) &&
        location.getTime() < currentLocation.getTime()) {
      return;
    }
  }
  // Update magnetic declination once every minute
  // -- diff between "true north" and magnetic north in degrees
  if (declinationTime + 60000 < now) {
    declinationTime = now;
    GeomagneticField magneticField = new GeomagneticField(
        (float) location.getLatitude(), (float) location.getLongitude(),
        location.hasAltitude() ? (float) location.getAltitude() : 100f, // use 100m if not known
        declinationTime);
    compassDeclination = Float.valueOf(magneticField.getDeclination());
  }
  // If there is no bearing (lack of motion or network location), use latest compass heading
  if (!location.hasBearing() || !location.hasSpeed() || location.getSpeed() < 0.5f) {
    location.setBearing(compassHeading);
  }

  // Apply geoid height correction to altitude, if reported
  if (location.hasAltitude() && GeoidHeightEstimator.isInitialized()) {
    int geoidCm =
        GeoidHeightEstimator.computeGeoidHeight(location.getLatitude(), location.getLongitude());
    location.setAltitude(location.getAltitude() - Math.round(geoidCm / 100f));
  }

  // Update current location
  if (currentLocation != null) {
    currentLocation.set(location);
  } else {
    currentLocation = new Location(location);
  }

  if (location.getProvider().equals(LocationManager.GPS_PROVIDER)) {
    lastGpsTime = now;
  }
  updateSpeedAndAltitude(location);
}
OrientationManager.java 文件源码 项目:GlassNjslyr 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Updates the cached instance of the geomagnetic field after a location change.
 */
private void updateGeomagneticField() {
    mGeomagneticField = new GeomagneticField((float) mLocation.getLatitude(),
            (float) mLocation.getLongitude(), (float) mLocation.getAltitude(),
            mLocation.getTime());
}
LocationUtils.java 文件源码 项目:cgeo-wear 阅读 32 收藏 0 点赞 0 评论 0
/**
 * Handles compass rotation.
 */
@Override
public final void onSensorChanged(SensorEvent event) {
    if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
        gravity = event.values.clone();
    } else if(event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {
        geomagnetic = event.values.clone();
    }

    if(gravity != null && geomagnetic != null) {
        float[] R = new float[9];
        float[] I = new float[9];

        boolean success = SensorManager.getRotationMatrix(R, I, gravity, geomagnetic);
        if(success) {
            final float[] orientation = new float[3];
            SensorManager.getOrientation(R, orientation);
            float azimuth = (float) (Math.toDegrees(orientation[0]) + 360) % 360;

            if(currentLocation != null) {
                final float smoothedLatitude = smoothSensorValues(
                        oldLatitude, (float) currentLocation.getLatitude(), 1 / 3f);
                final float smoothedLongitude = smoothSensorValues(
                        oldLongitude, (float) currentLocation.getLongitude(), 1 / 3f);
                final float smoothedAltitude = smoothSensorValues(
                        oldAltitude, (float) currentLocation.getAltitude(), 1 / 3f);

                GeomagneticField geomagneticField = new GeomagneticField(
                        smoothedLatitude,
                        smoothedLongitude,
                        smoothedAltitude,
                        System.currentTimeMillis()
                );
                azimuth -= geomagneticField.getDeclination();

                final float bearing = currentLocation.bearingTo(geocacheLocation);

                final float newDirectionRaw = (360 - (azimuth-bearing)) % 360;

                final float newDirection = smoothSensorValues(oldDirection, newDirectionRaw, 1 / 5f);

                //Set old values to current values (for smoothing)
                oldDirection = newDirection;
                oldLatitude = smoothedLatitude;
                oldLongitude = smoothedLongitude;
                oldAltitude = smoothedAltitude;

                //Send direction update to Android Wear if update interval has passed
                final long currentTime = System.currentTimeMillis();
                if((currentTime - prevTime) > COMPASS_UPDATE_INTERVAL) {
                    onDirectionUpdateListener.onDirectionUpdate(newDirection);
                    prevTime = currentTime;
                }
            }
        }
    }
}
SensorUtils.java 文件源码 项目:commons-android 阅读 21 收藏 0 点赞 0 评论 0
public static float getLocationDeclination(Location location) {
    return new GeomagneticField((float) location.getLatitude(), (float) location.getLongitude(), (float) location.getAltitude(), location.getTime())
            .getDeclination();
}
OrientationManager.java 文件源码 项目:casa-glass 阅读 19 收藏 0 点赞 0 评论 0
/**
 * Updates the cached instance of the geomagnetic field after a location change.
 */
private void updateGeomagneticField() {
    mGeomagneticField = new GeomagneticField((float) mLocation.getLatitude(), (float) mLocation.getLongitude(), (float) mLocation.getAltitude(),
            mLocation.getTime());
}
SensorsOrientationManager.java 文件源码 项目:orientation-recorder 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Updates the cached instance of the geomagnetic field after a location change.
 */
private void updateGeomagneticField() {
    mGeomagneticField = new GeomagneticField((float) mLocation.getLatitude(),
            (float) mLocation.getLongitude(), (float) mLocation.getAltitude(),
            mLocation.getTime());
}
OrientationManager.java 文件源码 项目:gdk-line-sample 阅读 20 收藏 0 点赞 0 评论 0
/**
 * Updates the cached instance of the geomagnetic field after a location change.
 */
private void updateGeomagneticField() {
    mGeomagneticField = new GeomagneticField((float) mLocation.getLatitude(),
            (float) mLocation.getLongitude(), (float) mLocation.getAltitude(),
            mLocation.getTime());
}
OrientationManager.java 文件源码 项目:kitty-compass 阅读 23 收藏 0 点赞 0 评论 0
/**
 * Updates the cached instance of the geomagnetic field after a location change.
 */
private void updateGeomagneticField() {
    mGeomagneticField = new GeomagneticField((float) mLocation.getLatitude(),
            (float) mLocation.getLongitude(), (float) mLocation.getAltitude(),
            mLocation.getTime());
}
OrientationManager.java 文件源码 项目:SpeedHud 阅读 23 收藏 0 点赞 0 评论 0
/**
 * Updates the cached instance of the geomagnetic field after a location change.
 */
private void updateGeomagneticField() {
    mGeomagneticField = new GeomagneticField((float) mLocation.getLatitude(),
            (float) mLocation.getLongitude(), (float) mLocation.getAltitude(),
            mLocation.getTime());
}
OrientationManager.java 文件源码 项目:PTVGlass 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Updates the cached instance of the geomagnetic field after a location change.
 */
private void updateGeomagneticField() {
    mGeomagneticField = new GeomagneticField((float) mLocation.getLatitude(),
            (float) mLocation.getLongitude(), (float) mLocation.getAltitude(),
            mLocation.getTime());
}


问题


面经


文章

微信
公众号

扫码关注公众号