@@ -21,7 +21,7 @@ Android app in this repo.
2121
2222### Integrating GeoFire with your data
2323
24- GeoFire is designed as a lightweight add-on to Firebase. However, to keep things
24+ GeoFire is designed as a lightweight add-on to the Firebase Realtime Database . However, to keep things
2525simple, GeoFire stores data in its own format and its own location within
2626your Firebase database. This allows your existing data format and security rules to
2727remain unchanged and for you to add GeoFire as an easy solution for geo queries
@@ -41,6 +41,10 @@ at `/bars/<bar-id>`.
4141
4242## Upgrading GeoFire
4343
44+ ### Upgrading from GeoFire 1.x to 2.x
45+
46+ GeoFire 2.0.0 is based on the new 3.x release of [ Firebase] ( https://firebase.google.com ) .
47+
4448### Upgrading from GeoFire 1.0.x to 1.1.x
4549
4650With the release of GeoFire for Android/Java 1.1.0, this library now uses [ the new query
@@ -53,31 +57,32 @@ and [read our docs for more information about indexing your data](https://www.fi
5357
5458## Including GeoFire in your project Android/Java
5559
56- In order to use GeoFire in your project, you need to [ add the Firebase Java
57- SDK] ( https://www.firebase.com/docs/java-quickstart.html?utm_source=geofire-java ) .
58- There are then multiple possibilities to use GeoFire in your project.
60+ In order to use GeoFire in your project, you need to [ add the Firebase Android
61+ SDK] ( https://firebase.google.com/docs/android/setup ) . After that you can include
62+ GeoFire with one of the choices below.
63+
64+ ### Gradle
65+
66+ Add a dependency for GeoFire to your ` gradle.build ` file:
67+
68+ ``` groovy
69+ dependencies {
70+ compile 'com.firebase:geofire:2.0.0'
71+ }
72+ ```
5973
6074### Maven
6175
62- Add GeoFire to your Maven enabled projects with a new dependency :
76+ GeoFire also works with Maven :
6377
6478``` xml
6579<dependency >
6680 <groupId >com.firebase</groupId >
6781 <artifactId >geofire</artifactId >
68- <version >[1.1.0,) </version >
82+ <version >2.0.0 </version >
6983</dependency >
7084```
7185
72- ### Gradle
73-
74- Likewise, you can add a dependency to your ` gradle.build ` file:
75-
76- ``` groovy
77- dependencies {
78- compile 'com.firebase:geofire:1.1.0+'
79- }
80- ```
8186
8287### Jar-File
8388
@@ -88,7 +93,7 @@ page](https://github.com/firebase/geofire-java/releases).
8893## Getting Started with Firebase
8994
9095GeoFire requires the Firebase database in order to store location data. You can [ sign up here for a free
91- account] ( https://www .firebase.com/signup/?utm_source=geofire-java ) .
96+ account] ( https://console .firebase.google. com/ ) .
9297
9398
9499## Quickstart
@@ -103,7 +108,8 @@ database and to create queries. To create a new `GeoFire` instance you need to a
103108reference.
104109
105110``` java
106- GeoFire geoFire = new GeoFire (new Firebase (" https://<your-firebase>.firebaseio.com/" ));
111+ DatabaseReference ref = FirebaseDatabase . getInstance(). getReference(" path/to/geofire" );
112+ GeoFire geoFire = new GeoFire (ref);
107113```
108114
109115Note that you can point your reference to anywhere in your Firebase database, but don't
@@ -158,8 +164,8 @@ geoFire.getLocation("firebase-hq", new LocationCallback() {
158164 }
159165
160166 @Override
161- public void onCancelled (FirebaseError firebaseError ) {
162- System . err. println(" There was an error getting the GeoFire location: " + firebaseError );
167+ public void onCancelled (DatabaseError databaseError ) {
168+ System . err. println(" There was an error getting the GeoFire location: " + databaseError );
163169 }
164170});
165171```
@@ -229,7 +235,7 @@ geoQuery.addGeoQueryEventListener(new GeoQueryEventListener() {
229235 }
230236
231237 @Override
232- public void onGeoQueryError (FirebaseError error ) {
238+ public void onGeoQueryError (DatabaseError error ) {
233239 System . err. println(" There was an error with this query: " + error);
234240 }
235241});
0 commit comments