Android Open Source - LocBox Walk






From Project

Back to project page LocBox.

License

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.

Java Source Code

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; }
}




Java Source Code List

com.codebrane.locbox.LocationReceiver.java
com.codebrane.locbox.LocboxActivity.java
com.codebrane.locbox.LocboxManager.java
com.codebrane.locbox.SingleFragmentActivity.java
com.codebrane.locbox.controller.LocboxFragment.java
com.codebrane.locbox.model.CBLocation.java
com.codebrane.locbox.model.Walk.java