Skip to content
Advertisement

Android Studio – how to find nearest array location of my current location

the schema is I have 3 locations and I need to find where is the nearest location depending on my current location.

how to achieve that ?

and is it possible to use FusedLocation instead of LocationManager ?

Advertisement

Answer

you can use

JavaScript

place1 its current location

JavaScript

place2 its one of our location

JavaScript

I use this function to switch to another activity if the distance is less than 5 meters

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement