Android Vitals issue with only 1 geofence hotspot












0














In our app some days ago we were facing lot of issue with android vitals so we turned off all our geofence hotspots and vitals were ok but now we turned on only 1 hotspot with a radius of 15km and enabled callback for ENTER,EXIT & DWELL, but we are again facing vital issue with only 1 hotspot..don't know what is going on here, if anyone have any idea please help..below is the code -



public class GeoFenceManager implements OnCompleteListener<Void> {

/**
* Provides access to the Geofencing API.
*/
private GeofencingClient mGeofencingClient;

/**
* The list of geofences used in this sample.
*/
private ArrayList<Geofence> mGeofenceList;

/**
* Used when requesting to add or remove geofences.
*/
private PendingIntent mGeofencePendingIntent;

private WeakReference<Context> context;

private static GeoFenceManager geoFenceManager;

public static synchronized GeoFenceManager getInstance(Context context) {
if (geoFenceManager == null) {
geoFenceManager = new GeoFenceManager();
}
GeoFenceManager.geoFenceManager.context = new WeakReference<>(context);
return geoFenceManager;
}

private GeoFenceManager() {

}

public void init(Context context) {
mGeofencePendingIntent = null;
// Empty list for storing geofences.
if (mGeofenceList == null) {
mGeofenceList = new ArrayList<>();
} else {
mGeofenceList.clear();
}
mGeofencingClient = LocationServices.getGeofencingClient(context);
populateGeofenceList();
addGeofences();
}

@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Logger.DEBUG("Geofence added");
} else {
// Get the status code for the error and log it using a user-friendly message.
String errorMessage = GeofenceErrorMessages.getErrorString(context.get(), task.getException());
Logger.DEBUG(errorMessage);
}
}

/**
* Adds geofences. This method should be called after the user has granted the location
* permission.
*/
@SuppressWarnings("MissingPermission")
private void addGeofences() {
if (!checkPermissions()) {
return;
}
if (mGeofencingClient != null) {
mGeofencingClient.removeGeofences(getGeofencePendingIntent()).addOnCompleteListener(this);
if (mGeofenceList != null && mGeofenceList.size() > 0) {
mGeofencingClient.addGeofences(getGeofencingRequest(), getGeofencePendingIntent())
.addOnCompleteListener(this);
}
}
}

/**
* Builds and returns a GeofencingRequest. Specifies the list of geofences to be monitored.
* Also specifies how the geofence notifications are initially triggered.
*/
private GeofencingRequest getGeofencingRequest() {
GeofencingRequest.Builder builder = new GeofencingRequest.Builder();

// The INITIAL_TRIGGER_ENTER flag indicates that geofencing service should trigger a
// GEOFENCE_TRANSITION_ENTER notification when the geofence is added and if the device
// is already inside that geofence.
builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER | GeofencingRequest.INITIAL_TRIGGER_DWELL);

// Add the geofences to be monitored by geofencing service.
builder.addGeofences(mGeofenceList);

// Return a GeofencingRequest.
return builder.build();
}

/**
* Removes geofences. This method should be called after the user has granted the location
* permission.
*/
@SuppressWarnings("MissingPermission")
public void removeGeofences() {
if (!checkPermissions()) {
return;
}
if (mGeofenceList != null) {
mGeofenceList.clear();
}
if (mGeofencingClient != null) {
mGeofencingClient.removeGeofences(getGeofencePendingIntent()).addOnCompleteListener(this);
}
}

/**
* Return the current state of the permissions needed.
*/
private boolean checkPermissions() {
int permissionState = ActivityCompat.checkSelfPermission(context.get(),
Manifest.permission.ACCESS_FINE_LOCATION);
return permissionState == PackageManager.PERMISSION_GRANTED;
}

/**
* Gets a PendingIntent to send with the request to add or remove Geofences. Location Services
* issues the Intent inside this PendingIntent whenever a geofence transition occurs for the
* current list of geofences.
*
* @return A PendingIntent for the IntentService that handles geofence transitions.
*/
private PendingIntent getGeofencePendingIntent() {
// Reuse the PendingIntent if we already have it.
if (mGeofencePendingIntent != null) {
return mGeofencePendingIntent;
}
Intent intent = new Intent(context.get(), GeofenceTransitionsIntentService.class);
// We use FLAG_UPDATE_CURRENT so that we get the same pending intent back when calling
// addGeofences() and removeGeofences().
return PendingIntent.getService(context.get(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
}

/*
* This sample hard codes geofence data. A real app might dynamically create geofences based on
* the user's location.
*/
private void populateGeofenceList() {
mGeofenceList.clear();
HotSpotResponse hotSpotResponse = PreferenceKeeper.getHotspotData(context.get());
if (hotSpotResponse != null && hotSpotResponse.hotspots != null && hotSpotResponse.hotspots.size() > 0) {
for (HotSpots hotSpot : hotSpotResponse.hotspots) {
if (hotSpot.radius > 0) {
mGeofenceList.add(new Geofence.Builder()
// Set the request ID of the geofence. This is a string to identify this
// geofence.
.setNotificationResponsiveness(hotSpot.notificationResponsiveTime != null ? hotSpot.notificationResponsiveTime : 420000)
.setRequestId(hotSpot.isOuter ? AppConstant.MY_GEOFENCE_ID : hotSpot.id + "")

// Set the circular region of this geofence.
.setCircularRegion(
hotSpot.center.lat,
hotSpot.center.lng,
hotSpot.radius
)

// Set the expiration duration of the geofence. This geofence gets automatically
// removed after this period of time.
.setExpirationDuration(Geofence.NEVER_EXPIRE)

.setLoiteringDelay((int) hotSpot.dwellTime) //hard coded the dwell time as 10 minutes for now for each hotspot

// Set the transition types of interest. Alerts are only generated for these
// transition. We track entry and exit transitions in this sample.
.setTransitionTypes(hotSpot.transitionType != 0 ? hotSpot.transitionType : 7)
// Create the geofence.
.build());
}
}
}
}


}










share|improve this question



























    0














    In our app some days ago we were facing lot of issue with android vitals so we turned off all our geofence hotspots and vitals were ok but now we turned on only 1 hotspot with a radius of 15km and enabled callback for ENTER,EXIT & DWELL, but we are again facing vital issue with only 1 hotspot..don't know what is going on here, if anyone have any idea please help..below is the code -



    public class GeoFenceManager implements OnCompleteListener<Void> {

    /**
    * Provides access to the Geofencing API.
    */
    private GeofencingClient mGeofencingClient;

    /**
    * The list of geofences used in this sample.
    */
    private ArrayList<Geofence> mGeofenceList;

    /**
    * Used when requesting to add or remove geofences.
    */
    private PendingIntent mGeofencePendingIntent;

    private WeakReference<Context> context;

    private static GeoFenceManager geoFenceManager;

    public static synchronized GeoFenceManager getInstance(Context context) {
    if (geoFenceManager == null) {
    geoFenceManager = new GeoFenceManager();
    }
    GeoFenceManager.geoFenceManager.context = new WeakReference<>(context);
    return geoFenceManager;
    }

    private GeoFenceManager() {

    }

    public void init(Context context) {
    mGeofencePendingIntent = null;
    // Empty list for storing geofences.
    if (mGeofenceList == null) {
    mGeofenceList = new ArrayList<>();
    } else {
    mGeofenceList.clear();
    }
    mGeofencingClient = LocationServices.getGeofencingClient(context);
    populateGeofenceList();
    addGeofences();
    }

    @Override
    public void onComplete(@NonNull Task<Void> task) {
    if (task.isSuccessful()) {
    Logger.DEBUG("Geofence added");
    } else {
    // Get the status code for the error and log it using a user-friendly message.
    String errorMessage = GeofenceErrorMessages.getErrorString(context.get(), task.getException());
    Logger.DEBUG(errorMessage);
    }
    }

    /**
    * Adds geofences. This method should be called after the user has granted the location
    * permission.
    */
    @SuppressWarnings("MissingPermission")
    private void addGeofences() {
    if (!checkPermissions()) {
    return;
    }
    if (mGeofencingClient != null) {
    mGeofencingClient.removeGeofences(getGeofencePendingIntent()).addOnCompleteListener(this);
    if (mGeofenceList != null && mGeofenceList.size() > 0) {
    mGeofencingClient.addGeofences(getGeofencingRequest(), getGeofencePendingIntent())
    .addOnCompleteListener(this);
    }
    }
    }

    /**
    * Builds and returns a GeofencingRequest. Specifies the list of geofences to be monitored.
    * Also specifies how the geofence notifications are initially triggered.
    */
    private GeofencingRequest getGeofencingRequest() {
    GeofencingRequest.Builder builder = new GeofencingRequest.Builder();

    // The INITIAL_TRIGGER_ENTER flag indicates that geofencing service should trigger a
    // GEOFENCE_TRANSITION_ENTER notification when the geofence is added and if the device
    // is already inside that geofence.
    builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER | GeofencingRequest.INITIAL_TRIGGER_DWELL);

    // Add the geofences to be monitored by geofencing service.
    builder.addGeofences(mGeofenceList);

    // Return a GeofencingRequest.
    return builder.build();
    }

    /**
    * Removes geofences. This method should be called after the user has granted the location
    * permission.
    */
    @SuppressWarnings("MissingPermission")
    public void removeGeofences() {
    if (!checkPermissions()) {
    return;
    }
    if (mGeofenceList != null) {
    mGeofenceList.clear();
    }
    if (mGeofencingClient != null) {
    mGeofencingClient.removeGeofences(getGeofencePendingIntent()).addOnCompleteListener(this);
    }
    }

    /**
    * Return the current state of the permissions needed.
    */
    private boolean checkPermissions() {
    int permissionState = ActivityCompat.checkSelfPermission(context.get(),
    Manifest.permission.ACCESS_FINE_LOCATION);
    return permissionState == PackageManager.PERMISSION_GRANTED;
    }

    /**
    * Gets a PendingIntent to send with the request to add or remove Geofences. Location Services
    * issues the Intent inside this PendingIntent whenever a geofence transition occurs for the
    * current list of geofences.
    *
    * @return A PendingIntent for the IntentService that handles geofence transitions.
    */
    private PendingIntent getGeofencePendingIntent() {
    // Reuse the PendingIntent if we already have it.
    if (mGeofencePendingIntent != null) {
    return mGeofencePendingIntent;
    }
    Intent intent = new Intent(context.get(), GeofenceTransitionsIntentService.class);
    // We use FLAG_UPDATE_CURRENT so that we get the same pending intent back when calling
    // addGeofences() and removeGeofences().
    return PendingIntent.getService(context.get(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    }

    /*
    * This sample hard codes geofence data. A real app might dynamically create geofences based on
    * the user's location.
    */
    private void populateGeofenceList() {
    mGeofenceList.clear();
    HotSpotResponse hotSpotResponse = PreferenceKeeper.getHotspotData(context.get());
    if (hotSpotResponse != null && hotSpotResponse.hotspots != null && hotSpotResponse.hotspots.size() > 0) {
    for (HotSpots hotSpot : hotSpotResponse.hotspots) {
    if (hotSpot.radius > 0) {
    mGeofenceList.add(new Geofence.Builder()
    // Set the request ID of the geofence. This is a string to identify this
    // geofence.
    .setNotificationResponsiveness(hotSpot.notificationResponsiveTime != null ? hotSpot.notificationResponsiveTime : 420000)
    .setRequestId(hotSpot.isOuter ? AppConstant.MY_GEOFENCE_ID : hotSpot.id + "")

    // Set the circular region of this geofence.
    .setCircularRegion(
    hotSpot.center.lat,
    hotSpot.center.lng,
    hotSpot.radius
    )

    // Set the expiration duration of the geofence. This geofence gets automatically
    // removed after this period of time.
    .setExpirationDuration(Geofence.NEVER_EXPIRE)

    .setLoiteringDelay((int) hotSpot.dwellTime) //hard coded the dwell time as 10 minutes for now for each hotspot

    // Set the transition types of interest. Alerts are only generated for these
    // transition. We track entry and exit transitions in this sample.
    .setTransitionTypes(hotSpot.transitionType != 0 ? hotSpot.transitionType : 7)
    // Create the geofence.
    .build());
    }
    }
    }
    }


    }










    share|improve this question

























      0












      0








      0


      0





      In our app some days ago we were facing lot of issue with android vitals so we turned off all our geofence hotspots and vitals were ok but now we turned on only 1 hotspot with a radius of 15km and enabled callback for ENTER,EXIT & DWELL, but we are again facing vital issue with only 1 hotspot..don't know what is going on here, if anyone have any idea please help..below is the code -



      public class GeoFenceManager implements OnCompleteListener<Void> {

      /**
      * Provides access to the Geofencing API.
      */
      private GeofencingClient mGeofencingClient;

      /**
      * The list of geofences used in this sample.
      */
      private ArrayList<Geofence> mGeofenceList;

      /**
      * Used when requesting to add or remove geofences.
      */
      private PendingIntent mGeofencePendingIntent;

      private WeakReference<Context> context;

      private static GeoFenceManager geoFenceManager;

      public static synchronized GeoFenceManager getInstance(Context context) {
      if (geoFenceManager == null) {
      geoFenceManager = new GeoFenceManager();
      }
      GeoFenceManager.geoFenceManager.context = new WeakReference<>(context);
      return geoFenceManager;
      }

      private GeoFenceManager() {

      }

      public void init(Context context) {
      mGeofencePendingIntent = null;
      // Empty list for storing geofences.
      if (mGeofenceList == null) {
      mGeofenceList = new ArrayList<>();
      } else {
      mGeofenceList.clear();
      }
      mGeofencingClient = LocationServices.getGeofencingClient(context);
      populateGeofenceList();
      addGeofences();
      }

      @Override
      public void onComplete(@NonNull Task<Void> task) {
      if (task.isSuccessful()) {
      Logger.DEBUG("Geofence added");
      } else {
      // Get the status code for the error and log it using a user-friendly message.
      String errorMessage = GeofenceErrorMessages.getErrorString(context.get(), task.getException());
      Logger.DEBUG(errorMessage);
      }
      }

      /**
      * Adds geofences. This method should be called after the user has granted the location
      * permission.
      */
      @SuppressWarnings("MissingPermission")
      private void addGeofences() {
      if (!checkPermissions()) {
      return;
      }
      if (mGeofencingClient != null) {
      mGeofencingClient.removeGeofences(getGeofencePendingIntent()).addOnCompleteListener(this);
      if (mGeofenceList != null && mGeofenceList.size() > 0) {
      mGeofencingClient.addGeofences(getGeofencingRequest(), getGeofencePendingIntent())
      .addOnCompleteListener(this);
      }
      }
      }

      /**
      * Builds and returns a GeofencingRequest. Specifies the list of geofences to be monitored.
      * Also specifies how the geofence notifications are initially triggered.
      */
      private GeofencingRequest getGeofencingRequest() {
      GeofencingRequest.Builder builder = new GeofencingRequest.Builder();

      // The INITIAL_TRIGGER_ENTER flag indicates that geofencing service should trigger a
      // GEOFENCE_TRANSITION_ENTER notification when the geofence is added and if the device
      // is already inside that geofence.
      builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER | GeofencingRequest.INITIAL_TRIGGER_DWELL);

      // Add the geofences to be monitored by geofencing service.
      builder.addGeofences(mGeofenceList);

      // Return a GeofencingRequest.
      return builder.build();
      }

      /**
      * Removes geofences. This method should be called after the user has granted the location
      * permission.
      */
      @SuppressWarnings("MissingPermission")
      public void removeGeofences() {
      if (!checkPermissions()) {
      return;
      }
      if (mGeofenceList != null) {
      mGeofenceList.clear();
      }
      if (mGeofencingClient != null) {
      mGeofencingClient.removeGeofences(getGeofencePendingIntent()).addOnCompleteListener(this);
      }
      }

      /**
      * Return the current state of the permissions needed.
      */
      private boolean checkPermissions() {
      int permissionState = ActivityCompat.checkSelfPermission(context.get(),
      Manifest.permission.ACCESS_FINE_LOCATION);
      return permissionState == PackageManager.PERMISSION_GRANTED;
      }

      /**
      * Gets a PendingIntent to send with the request to add or remove Geofences. Location Services
      * issues the Intent inside this PendingIntent whenever a geofence transition occurs for the
      * current list of geofences.
      *
      * @return A PendingIntent for the IntentService that handles geofence transitions.
      */
      private PendingIntent getGeofencePendingIntent() {
      // Reuse the PendingIntent if we already have it.
      if (mGeofencePendingIntent != null) {
      return mGeofencePendingIntent;
      }
      Intent intent = new Intent(context.get(), GeofenceTransitionsIntentService.class);
      // We use FLAG_UPDATE_CURRENT so that we get the same pending intent back when calling
      // addGeofences() and removeGeofences().
      return PendingIntent.getService(context.get(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
      }

      /*
      * This sample hard codes geofence data. A real app might dynamically create geofences based on
      * the user's location.
      */
      private void populateGeofenceList() {
      mGeofenceList.clear();
      HotSpotResponse hotSpotResponse = PreferenceKeeper.getHotspotData(context.get());
      if (hotSpotResponse != null && hotSpotResponse.hotspots != null && hotSpotResponse.hotspots.size() > 0) {
      for (HotSpots hotSpot : hotSpotResponse.hotspots) {
      if (hotSpot.radius > 0) {
      mGeofenceList.add(new Geofence.Builder()
      // Set the request ID of the geofence. This is a string to identify this
      // geofence.
      .setNotificationResponsiveness(hotSpot.notificationResponsiveTime != null ? hotSpot.notificationResponsiveTime : 420000)
      .setRequestId(hotSpot.isOuter ? AppConstant.MY_GEOFENCE_ID : hotSpot.id + "")

      // Set the circular region of this geofence.
      .setCircularRegion(
      hotSpot.center.lat,
      hotSpot.center.lng,
      hotSpot.radius
      )

      // Set the expiration duration of the geofence. This geofence gets automatically
      // removed after this period of time.
      .setExpirationDuration(Geofence.NEVER_EXPIRE)

      .setLoiteringDelay((int) hotSpot.dwellTime) //hard coded the dwell time as 10 minutes for now for each hotspot

      // Set the transition types of interest. Alerts are only generated for these
      // transition. We track entry and exit transitions in this sample.
      .setTransitionTypes(hotSpot.transitionType != 0 ? hotSpot.transitionType : 7)
      // Create the geofence.
      .build());
      }
      }
      }
      }


      }










      share|improve this question













      In our app some days ago we were facing lot of issue with android vitals so we turned off all our geofence hotspots and vitals were ok but now we turned on only 1 hotspot with a radius of 15km and enabled callback for ENTER,EXIT & DWELL, but we are again facing vital issue with only 1 hotspot..don't know what is going on here, if anyone have any idea please help..below is the code -



      public class GeoFenceManager implements OnCompleteListener<Void> {

      /**
      * Provides access to the Geofencing API.
      */
      private GeofencingClient mGeofencingClient;

      /**
      * The list of geofences used in this sample.
      */
      private ArrayList<Geofence> mGeofenceList;

      /**
      * Used when requesting to add or remove geofences.
      */
      private PendingIntent mGeofencePendingIntent;

      private WeakReference<Context> context;

      private static GeoFenceManager geoFenceManager;

      public static synchronized GeoFenceManager getInstance(Context context) {
      if (geoFenceManager == null) {
      geoFenceManager = new GeoFenceManager();
      }
      GeoFenceManager.geoFenceManager.context = new WeakReference<>(context);
      return geoFenceManager;
      }

      private GeoFenceManager() {

      }

      public void init(Context context) {
      mGeofencePendingIntent = null;
      // Empty list for storing geofences.
      if (mGeofenceList == null) {
      mGeofenceList = new ArrayList<>();
      } else {
      mGeofenceList.clear();
      }
      mGeofencingClient = LocationServices.getGeofencingClient(context);
      populateGeofenceList();
      addGeofences();
      }

      @Override
      public void onComplete(@NonNull Task<Void> task) {
      if (task.isSuccessful()) {
      Logger.DEBUG("Geofence added");
      } else {
      // Get the status code for the error and log it using a user-friendly message.
      String errorMessage = GeofenceErrorMessages.getErrorString(context.get(), task.getException());
      Logger.DEBUG(errorMessage);
      }
      }

      /**
      * Adds geofences. This method should be called after the user has granted the location
      * permission.
      */
      @SuppressWarnings("MissingPermission")
      private void addGeofences() {
      if (!checkPermissions()) {
      return;
      }
      if (mGeofencingClient != null) {
      mGeofencingClient.removeGeofences(getGeofencePendingIntent()).addOnCompleteListener(this);
      if (mGeofenceList != null && mGeofenceList.size() > 0) {
      mGeofencingClient.addGeofences(getGeofencingRequest(), getGeofencePendingIntent())
      .addOnCompleteListener(this);
      }
      }
      }

      /**
      * Builds and returns a GeofencingRequest. Specifies the list of geofences to be monitored.
      * Also specifies how the geofence notifications are initially triggered.
      */
      private GeofencingRequest getGeofencingRequest() {
      GeofencingRequest.Builder builder = new GeofencingRequest.Builder();

      // The INITIAL_TRIGGER_ENTER flag indicates that geofencing service should trigger a
      // GEOFENCE_TRANSITION_ENTER notification when the geofence is added and if the device
      // is already inside that geofence.
      builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER | GeofencingRequest.INITIAL_TRIGGER_DWELL);

      // Add the geofences to be monitored by geofencing service.
      builder.addGeofences(mGeofenceList);

      // Return a GeofencingRequest.
      return builder.build();
      }

      /**
      * Removes geofences. This method should be called after the user has granted the location
      * permission.
      */
      @SuppressWarnings("MissingPermission")
      public void removeGeofences() {
      if (!checkPermissions()) {
      return;
      }
      if (mGeofenceList != null) {
      mGeofenceList.clear();
      }
      if (mGeofencingClient != null) {
      mGeofencingClient.removeGeofences(getGeofencePendingIntent()).addOnCompleteListener(this);
      }
      }

      /**
      * Return the current state of the permissions needed.
      */
      private boolean checkPermissions() {
      int permissionState = ActivityCompat.checkSelfPermission(context.get(),
      Manifest.permission.ACCESS_FINE_LOCATION);
      return permissionState == PackageManager.PERMISSION_GRANTED;
      }

      /**
      * Gets a PendingIntent to send with the request to add or remove Geofences. Location Services
      * issues the Intent inside this PendingIntent whenever a geofence transition occurs for the
      * current list of geofences.
      *
      * @return A PendingIntent for the IntentService that handles geofence transitions.
      */
      private PendingIntent getGeofencePendingIntent() {
      // Reuse the PendingIntent if we already have it.
      if (mGeofencePendingIntent != null) {
      return mGeofencePendingIntent;
      }
      Intent intent = new Intent(context.get(), GeofenceTransitionsIntentService.class);
      // We use FLAG_UPDATE_CURRENT so that we get the same pending intent back when calling
      // addGeofences() and removeGeofences().
      return PendingIntent.getService(context.get(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
      }

      /*
      * This sample hard codes geofence data. A real app might dynamically create geofences based on
      * the user's location.
      */
      private void populateGeofenceList() {
      mGeofenceList.clear();
      HotSpotResponse hotSpotResponse = PreferenceKeeper.getHotspotData(context.get());
      if (hotSpotResponse != null && hotSpotResponse.hotspots != null && hotSpotResponse.hotspots.size() > 0) {
      for (HotSpots hotSpot : hotSpotResponse.hotspots) {
      if (hotSpot.radius > 0) {
      mGeofenceList.add(new Geofence.Builder()
      // Set the request ID of the geofence. This is a string to identify this
      // geofence.
      .setNotificationResponsiveness(hotSpot.notificationResponsiveTime != null ? hotSpot.notificationResponsiveTime : 420000)
      .setRequestId(hotSpot.isOuter ? AppConstant.MY_GEOFENCE_ID : hotSpot.id + "")

      // Set the circular region of this geofence.
      .setCircularRegion(
      hotSpot.center.lat,
      hotSpot.center.lng,
      hotSpot.radius
      )

      // Set the expiration duration of the geofence. This geofence gets automatically
      // removed after this period of time.
      .setExpirationDuration(Geofence.NEVER_EXPIRE)

      .setLoiteringDelay((int) hotSpot.dwellTime) //hard coded the dwell time as 10 minutes for now for each hotspot

      // Set the transition types of interest. Alerts are only generated for these
      // transition. We track entry and exit transitions in this sample.
      .setTransitionTypes(hotSpot.transitionType != 0 ? hotSpot.transitionType : 7)
      // Create the geofence.
      .build());
      }
      }
      }
      }


      }







      android android-studio android-geofence android-vitals






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 '18 at 5:48









      kaustav07

      41110




      41110
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441227%2fandroid-vitals-issue-with-only-1-geofence-hotspot%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441227%2fandroid-vitals-issue-with-only-1-geofence-hotspot%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Basket-ball féminin

          Different font size/position of beamer's navigation symbols template's content depending on regular/plain...

          I want to find a topological embedding $f : X rightarrow Y$ and $g: Y rightarrow X$, yet $X$ is not...