Android Open Source - GeoAlarms Coordinates






From Project

Back to project page GeoAlarms.

License

The source code is released under:

GNU General Public License

If you think the Android project GeoAlarms 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.geoalarms.model;
//  w w w .  jav a2  s. c  om
import com.google.android.maps.GeoPoint;

import android.location.Location;

public class Coordinates {
    // in microdegrees
    public int latitude;
    public int longitude;

    private static final int E6 = 1000000;

    public Coordinates(int lat, int lon) {
        this.latitude = lat;
        this.longitude = lon;
    }

    public Coordinates(Location location) {
        this.latitude = (int) (location.getLatitude() * Coordinates.E6);
        this.longitude = (int) (location.getLongitude() * Coordinates.E6);
    }
    
    public Coordinates(GeoPoint point) {
        this.latitude = point.getLatitudeE6();
        this.longitude = point.getLongitudeE6();
    }

    public GeoPoint toGeoPoint() {
        return new GeoPoint(this.latitude, this.longitude);
    }

    public double getLatitude() {
        return this.latitude / Coordinates.E6;
    }

    public double getLongitude() {
        return this.longitude / Coordinates.E6;
    }
}




Java Source Code List

com.geoalarms.GeoAlarms.java
com.geoalarms.activity.AlarmEditor.java
com.geoalarms.activity.AlarmList.java
com.geoalarms.activity.Help.java
com.geoalarms.activity.Home.java
com.geoalarms.activity.Map.java
com.geoalarms.activity.Preferences.java
com.geoalarms.database.AlarmDatabaseHelper.java
com.geoalarms.database.AlarmManager.java
com.geoalarms.location.LocListener.java
com.geoalarms.location.ProximityIntentReceiver.java
com.geoalarms.map.AlarmOverlay.java
com.geoalarms.map.PointOverlay.java
com.geoalarms.model.Alarm.java
com.geoalarms.model.Coordinates.java