GPS - Getting the distance,time while running and walking

后端 未结 5 1249
情话喂你
情话喂你 2020-12-19 18:51

i have a situation where i need to use GPS technique.

i need to find the distance between two points when the person is walking.

When the person starts walki

5条回答
  •  爱一瞬间的悲伤
    2020-12-19 19:17

    You can find out the distance between two locations(in terms of latitude and longitude) by making use of Spherical Trigonometry

    Coming to time make use of simple date objects and compare the startTime and endTime.

    (OR)

    You can get approximate distance using below code

    double distance;  
    
    Location locationA = new Location("point A");  
    
    locationA.setLatitude(latA);  
    locationA.setLongitude(lngA);  
    
    Location locationB = new Location("point B");  
    
    locationB.setLatitude(latB);  
    LocationB.setLongitude(lngB);  
    
    distance = locationA.distanceTo(locationB); 
    

提交回复
热议问题