我是Android开发的新手,将非常感谢任何指导。我想知道在将坐标保存到Firebase时是否有一种方法可以解码GeoFire生成的GeoHash。我看不到来自GeoFire的服务,这些服务只能解码坐标以获取纬度或经度。如果有一个图书馆,请告诉我,我被困在一个项目中,进行了大量研究,但还没有找到任何有价值的东西。再次感谢!
---------------- CODE片段-------------------------
DatabaseReference mUser;
GeoFire geoFire;
FirebaseUser mFirebase;
Marker mCurrent;
Circle mPerimeter;
SupportMapFragment mapFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
// SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
//Init View
//-------AUTHENTICATION--------------
FirebaseAuth mAuth = FirebaseAuth.getInstance();
String userID;
userID = mAuth.getCurrentUser().getUid();
//-------AUTHENTICATION--------------
startLocationUpdates();
displayLocation();
Snackbar.make(mapFragment.getView(), "You are online",Snackbar.LENGTH_SHORT)
.show();
//--------SEND COORDINATES TO FIREBASE-------------
mUser = FirebaseDatabase.getInstance().getReference().child("Location");
geoFire =new GeoFire(mUser);
//--------SEND COORDINATES TO FIREBASE-------------
//------------------LOOKING FOR INSTRUCTIONS TO QUERY USERS LATITUDE OR LONGITUDE AND SAVE THEM TO A LOCAL VARIABLE
double latitude;
double longitude;
latitude =
longitude=
//------------------LOOKING FOR INSTRUCTIONS TO QUERY USERS LATITUDE OR LONGITUDE AND SAVE THEM TO A LOCAL VARIABLE
setUpLocation();
}
//Press Ctrl + O to override
//Request runtime permissions and override OnRequestPermissionResult method
---------------- CODE片段-------------------------