Android GPS State Check isSameGPSLocation(double lon, double lat, double lon1, double lat1)

Here you can find the source of isSameGPSLocation(double lon, double lat, double lon1, double lat1)

Description

Same as query for a location in DatabaseHelper.findClosestAirportID()

License

Open Source License

Parameter

Parameter Description
lon a parameter
lat a parameter
lon1 a parameter
lat1 a parameter

Declaration

public static boolean isSameGPSLocation(double lon, double lat,
        double lon1, double lat1) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w ww . j  a v  a2s. c om*/
     * Same as query for a location in DatabaseHelper.findClosestAirportID() 
     * @param lon
     * @param lat
     * @param lon1
     * @param lat1
     * @return
     */
    public static boolean isSameGPSLocation(double lon, double lat,
            double lon1, double lat1) {
        if (((lon - lon1) * (lon - lon1) + (lat - lat1) * (lat - lat1)) < 0.001) {
            return true;
        }
        return false;
    }
}

Related

  1. isGpsEnabled(Context c)