2

I am new to android programming. I want to make an app that can create proximity alerts based on the location coordinates stored in a server, that is compare user's current location with those stored in server and generate an alert if the location is within a particular radius. Is there any way to create proximity alerts for locations stored in a server ? Or is there any better approach for this problem ?

Thanks

Alexander
  • 576
  • 5
  • 17

1 Answers1

2

In android its quite simple to do that.

Please, take a look at this class

http://developer.android.com/reference/android/location/LocationManager.html

especially at this method:

  addProximityAlert(double, double, float, long, android.app.PendingIntent);

this is exactly what you need.

The android SDK docs are really well done. Take always a look there ! :D

Yngwie89
  • 1,217
  • 9
  • 17
  • Hi thanks, but i can call this method only after getting those location coordinates from server right? My problem here is how to get the bunch of location coordinates saved in server to the device and add proximity alert to each of them. Any suggestions? – Alexander Oct 01 '12 at 08:54
  • Hi, to download asimple file from your server to your device you can take this as example and than you have to parse that string in order to take out coordinates from there. Make an arraylist of coordinates and cycle it using the method I mentioned before. Remember that the method for downloading I linked you before is usefull just for small file. For big files use DownloadManager from Android SDK. – Yngwie89 Oct 01 '12 at 09:17