Esempio n. 1
0
 @Override
 public void onStatusChanged(String provider, int status, Bundle extras) {
   switch (status) {
     case LocationProvider.AVAILABLE:
       //                    binder.startRecord();
       Helper.Logger.i("Location provider is available.");
       break;
     case LocationProvider.OUT_OF_SERVICE:
       Helper.Logger.w("Location provider is out of service.");
       // binder.stopRecord();
       break;
     case LocationProvider.TEMPORARILY_UNAVAILABLE:
       Helper.Logger.w("Location provider is temporarily unavailable.");
       // binder.stopRecord();
       break;
   }
 }
Esempio n. 2
0
  /** flush cache */
  public void flushCache() {
    Iterator<Long> iterator = locationCache.keySet().iterator();
    while (iterator.hasNext()) {
      Long timeMillis = iterator.next();
      Location location = locationCache.get(timeMillis);
      if (archiver.add(location, timeMillis)) {
        Helper.Logger.i(
            String.format(
                "Location(%f, %f) has been saved into database.",
                location.getLatitude(), location.getLongitude()));
      }
    }

    locationCache.clear();
  }
Esempio n. 3
0
 @Override
 public void onProviderDisabled(String s) {
   Helper.Logger.w("Location provider is disabled.");
 }
Esempio n. 4
0
 @Override
 public void onProviderEnabled(String s) {
   Helper.Logger.i("Location provider is enabled.");
 }