Nov 6 · 1 min read
Yes, sure you can use this in Java class.
You’ll be needed to do following same steps as here https://github.com/chintan369/Geo-FireStore-Query?source=post_page-----bfb0ac1adf0a----------------------#to-retrive-the-list-of-items-from-center-location-with-the-given-radius
In Java
FirebaseFirestore db = FirebaseFirestore.getInstance();Location centerLocation = new Location(centerLatitude, centerLongitude)
Distance distanceForRadius = new Distance(1.0, DistanceUnit.KILOMETERS)GeoQuery geoQuery = new GeoQuery()
.collection("users")
.whereEqualTo("status","approved")
.whereEqualTo("country","IN")
.whereNearToLocation(centerLocation, distanceForRadius, fieldName)
.startAfter(lastDocument)
.limit(10)
