I am trying to connect to my Firebase account and make a query using a specific location to see if there are any GeoFire positions in it. For this I am using the official tutorials, but haven't been able to create a Geofire object. Here is what the Tutorial says:
A GeoFire object is used to read and write geo location data to your
Firebase database and to create queries. To create a new GeoFire
instance you need to attach it to a Firebase database reference.
DatabaseReference ref = FirebaseDatabase.getInstance().getReference("path/to/geofire");
GeoFire geoFire = new GeoFire(ref);
Firebase mLocs = new Firebase("https://example.firebaseio.com/Locations");
GeoFire geoFire = new GeoFire(mLocs);
com.google.firebase.database.DatabaseReference cannot be converted to
The tutorial is using the old Firebase SDK.
Follow this guide on how to setup the new Firebase SDK and then add the realtime database feature.
So, you will add these dependencies in the
Then, you can create
GeoFire instance using the guide from GeoFire for Android github page