How can I implement idle timeout in android?

What is the best way to implement geo-fencing using an android app?

  • I would like to know different approaches to implement geo-fencing for a shopping/lifestyle application on Android. The goal is not to drain the battery by polling the location continuously. Some ideas: Since it is a shopping app, we might poll it during lunch-times and evening times. I am looking for some good ideas on this.

  • Answer:

    There are multiple ways that one can implement geo-fencing in their android application - Android API: You can use the API addProximityAlert - http://developer.android.com/reference/android/location/LocationManager.html#addProximityAlert(double, double, float, long, android.app.PendingIntent). This API allows to set proximity alerts for specified locations. The problem is that on most phones this API will end up using a lot of battery. However, you can get a much better battery performance on devices that are powered by Qualcomm's Snapdragon powered devices(which is most of the android devices). http://bitly.com/Yk7nk1. Here is a good tutorial that shows how to use addProximityAlert() - http://bitly.com/fs9UhX Geofencing SDK:  You can use context awareness SDKs like Gimbal(https://www.gimbal.com/product/) which provide a very simple interface for Geofencing and other location/context based features.

Tushar Gupta at Quora Visit the source

Was this solution helpful to you?

Other answers

best way would be to receive location update at a defined interval

Rotshidzwa Ludzulu

You may consider Placer's technology, generating (with a low battery SDK) rich user profiles by leveraging user location in mobile applications 24/7 (installed in ~150 apps). Our customers use Placer's location technology and rich profiles for different use-cases, such as: Geo-fencing, Tracking, provide personalized services, targeted content, fraud detection, and better underwriting services (http://placer.io/http://placer.io/http://placer.io/).

Arik Bronshtein

I have implemented geofencing using the GeofencingApi in Google Play Services. It conserves battery and is very flexible. https://developers.google.com/android/reference/com/google/android/gms/location/GeofencingApi

Alejandro Nijamkin

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.