Back to project page LocBox.
The source code is released under:
MIT License
If you think the Android project LocBox listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.codebrane.locbox.model; // w w w .j a v a 2s . co m import java.util.Date; public class Walk { private Date startDate; public Walk() { startDate = new Date(); } public int getDurationSeconds(long endMillis) { return (int)((endMillis - startDate.getTime()) / 1000); } public static String formatDuration(int durationSeconds) { int seconds = durationSeconds % 60; int minutes = ((durationSeconds - seconds) / 60) % 60; int hours = (durationSeconds - (minutes * 60) - seconds) / 3600; return String.format("%02d:%02d:%02d", hours, minutes, seconds); } // getters public Date getStartDate() { return startDate; } // setters public void setStartDate(Date startDate) { this.startDate = startDate; } }