But I don't know what latitude and longitude to put for "endLat" and "ednLon".
endLat, endLon is a confusing name:
You should have lastLat, lastLon: the lat,lon received in the previous call of onGpsUpdate, save that into your e.g distanceCalculator.lastLat where distanceCalculator is an object where you store that lastLat, and lastLon
Then you should have curLat, curLon: current lat, lon delivered in onGPSUpdate
Then calculate the distance from (lastLat, lastLon) -> (curLat, curLon), and update your distanceCalculator.lastLat and lastLon.