I'm working on a Android app which have feature of nearby friends. So each user have list of friends stored in a Firebase real time database. Also their locations are saved there while they are moving around.
What I want to do?
I want to compare all the user freinds locations with the user location. And if the distance between the user and his friend is one km or less then the nearby friends list will be updated. This check will be done for reach friend for the user that is using the app.
What I tried to?
Before posting this question I searched around and found one answer on Stack Overflow. But I don't get the function which calculates the distance because the variables names are short and not self explanatory.
Based on the written above does anyone knew how can I calculate distance between two location or can summarize what the functions does which is shown on the link above.