How do I get a reminder off my mobile?

How can I get to know that a user has reached into his desired location and give him local notification as a reminder in Android?

  • I know their is a Idea to always get the latitude and longitude of current location of the user and get a distance between the desired location latitiude and longitue  by using http://developer.android.com/reference/android/location/Location.html#distanceBetween(double,%20double,%20double,%20double,%20float%5B%5D) method of location class, but it will drain battery very fastly and it is a bad practice to do it.I want to get an optimize solution with less battery drain and notify user about desired location when user is 50 meter near to it.

  • Answer:

    Using geofencing you can do this task. Geofencing combines awareness of the user's current location with awareness of the user's proximity to locations that may be of interest. To mark a location of interest, you specify its latitude and longitude. To adjust the proximity for the location, you add a radius. The latitude, longitude, and radius define a geofence, creating a circular area, or fence, around the location of interest.You can have multiple active geofences, with a limit of 100 per device user. For each geofence, you can ask Location Services to send you entrance and exit events, or you can specify a duration within the geofence area to wait, or dwell, before triggering an event. You can limit the duration of any geofence by specifying an expiration duration in milliseconds. After the geofence expires, Location Services automatically removes it. Source : http://developer.google.com/ http://developer.android.com/training/location/geofencing.html is a lesson about geofencing in http://developer.google.com/ site.

Saurabh Chaudhari at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

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.