ContentProvider doesn't have anything to do with locations.

It's an abstraction for data access with some useful functionality (like cross-application data access, data change notifications, etc.).

You could implement your own, and it could be useful if you wanted to access your data from multiple activities. But it's not necessary, strictly speaking - unless you wanted to expose this data to other applications in a defined way.

Now as for location filtering - I'd try and do some rough filtering right in the SQL query (perhaps based on a "box" aligned along the latitude / longitude grid), then perform fine filtering based on actual distance calculations (a circle centered on current position) on that data.

For computing the distance (for fine filtering) you could use this:

http://developer.android.com/reference/android/location/Location.html#distanceBetween(double, double, double, double, float[])

-- Kostya

24.11.2010 20:01, Guillaume пишет:
Hi all,
I need some help on how to show nearest locations, the right way.
I have in my DB a list of locations. I want to show the n nearest
locations (n choosen by the user) with some filters (show only
favorites, show only open etc...).
I think I should create a ContentProvider, but where do I do the
filtering ? Does the contentProvider has to send only the wanted
locations, or should he return the whole list, and so the mapView
should filtering locations by itself ?
Thanks for your help,
Guillaume



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to