Android Open Source - location-data Geo Location






From Project

Back to project page location-data.

License

The source code is released under:

GNU General Public License

If you think the Android project location-data 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.example.locationtracker;
/*from  w  w  w . j a va  2 s .  c  o  m*/
import java.util.Date;

public class GeoLocation {
  public String timestamp;
  public double latitude;
  public double longitude;
  
  GeoLocation(String timestamp, double latitude, double longitude) {
    this.timestamp = timestamp;
    this.latitude = latitude;
    this.longitude = longitude;
  }
  
  GeoLocation(double latitude, double longitude) {
    this.timestamp = this.getNow();
    this.latitude = latitude;
    this.longitude = longitude;
  }
  
  @Override
  public String toString() {
    return String.valueOf(this.latitude) + ", " + String.valueOf(this.longitude) + " [" + this.timestamp + "]";
  }
  
  private String getNow() {
        Date date = new Date();
        return String.valueOf(date.getTime());
  }
}




Java Source Code List

com.example.locationtracker.CachedRequesterDbHelper.java
com.example.locationtracker.CachedRequester.java
com.example.locationtracker.GPSTracker.java
com.example.locationtracker.GeoLocation.java
com.example.locationtracker.ILocationCallback.java
com.example.locationtracker.MainActivity.java