android - How to find out the average speed, while the speed value is generating per second -
i have code displays value of current speed using gps system. speed value changed every second, want generate average value of speed. have code generating value of average speed reference time, instead want display average speed values reference distance covered avg speed = distance covered in total time. code below:
private void actualizetextfield() { // todo auto-generated method stub textview tf = (textview) findviewbyid(r.id.textview3); if (count > 0) { float timeover = (system.currenttimemillis() - starttime); tf.settext(string.valueof(math.round(pointaverage * 3.6 / (timeover / 1000)))); } else { tf.settext("0"); } }
how can generate accurate values of average speed.
i'm not sure if understand problem, isn't you're looking "pace" instead of "speed"? speed has given formula , it's referenced time (distance/time) - covered distance in time. can flip fraction pace (time/distance) - used time cover distance.
Comments
Post a Comment