Do not get gps speed values (Location Manager settings are complete). If you import and move the current location, you can accumulate the gps distance. But it doesn't get the speed.)

Asked 2 years ago, Updated 2 years ago, 31 views

public float getSpeed(){ return speed; }

public void setSpeed(float speed){
    this.speed = speed;
}

public void onLocationChanged(Location location) {

    Log.d(TAG,location.hasSpeed()+"");
    if(location.hasSpeed()){
        speed = location.getSpeed();
        setSpeed(speed);
    }
}

android java

2022-09-22 13:00

1 Answers

How about setting the location?

If you set the location only through the network, you may not be able to speed up.


2022-09-22 13:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.