How to view locations near the current location of your Android Device

Asked

Viewed 4,482 times

3

First of all, I can already get my location and display a Maker, but I have a web service that provides the coordinates of a store network, in case I have to display the nearest stores, my doubt is if I have a list of coordinates as I do to show the closest?

2 answers

3


Try this:

Location loc;
.....
float radius = 50.0; // Raio em metros.
float distance = loc.distanceTo(loc2); // recebe distância entre os dois pontos.
if (distance < radius) then inside. // verifica se tá dentro do raio estipulado.

Reply taken from this question in the OS

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.