What logic is used when comparing locations with multiple users?

Using Android Studio, what things are needed when trying to compare a user's specific location with every other user. For example, if there are 1000 concurrent users, and I want to find the closest (or farthest) for any given user, what calculations should be performed?

If each user’s location has been saved in the database, where to start? Is it necessary to compare one location with 1000 (or more) users to find the closest one, or would it be more appropriate to make some type of cutoff (i.e. Compare only users who are within 50 km).

It seems overwhelming, and I'm new to android, so I'm not sure where to start. Parse.com and Pubnub are used in this project.

+4
source share
1 answer

Geohash by User Proximity Tutorial

I'll tell you about this in a geography tutorial that explains how to create a real-time application that connects users based on relative location. Please note that this example is written in JavaScript, not Java / Android. However, you can use this design pattern to determine proximity.

App Geo Location: https://www.pubnub.com/blog/2014-05-07-geohashing-chat-by-proximity/

, Geohasing.

Compare locations with multiple users

Parse SDK

: . Parse Connector SDK .

+2

Source: https://habr.com/ru/post/1617805/


All Articles