document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. public class GPSTracker extends Service implements LocationListener {
  2.  
  3.     private final Context mContext;
  4.  
  5.     // flag for GPS status
  6.     boolean isGPSEnabled = false;
  7.  
  8.     // flag for network status
  9.     boolean isNetworkEnabled = false;
  10.  
  11.     boolean canGetLocation = false;
  12.  
  13.     Location location; // location
  14.     double latitude; // latitude
  15.     double longitude; // longitude
  16.  
  17.     // The minimum distance to change Updates in meters
  18.     private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; // 10 meters
  19.  
  20.     // The minimum time between updates in milliseconds
  21.     private static final long MIN_TIME_BW_UPDATES = 1000 * 60 * 1; // 1 minute
  22.  
  23.     // Declaring a Location Manager
  24.     protected LocationManager locationManager;
  25.  
  26.     public GPSTracker(Context context) {
  27.         this.mContext = context;
  28.         getLocation();
  29.     }
');