问题描述
我开发了一个基于位置的应用程序,其运行方式如下:
-
我使用 Geofire 保存用户的位置如下(在 firebase 数据库中保存经纬度坐标):
if (UID != null) { geoFire.setLocation( UID,new GeoLocation( Lat_Coordinate,Lon_Coordinate ),(key,error) -> { if (error != null) { } else { } } ); }
-
我执行 Geofire 查询以在用户决定的特定距离内查找用户:
geoFire.getLocation( PersonID,new com.firebase.geofire.LocationCallback() { @Override public void onLocationResult(String key,GeoLocation location) { if (location != null) { float distance = CalculateDistance( Lat,Lon,location.latitude,location.longitude ); if (!PersonID.equals( UID )) { if (distance <= Radius) { distance = distance / 1000; MapPerson mapPerson = new MapPerson( PersonID,String.valueOf( Math.round( distance ) ),itemID ); personList.add( mapPerson ); Collections.sort( personList,(o1,o2) -> o2.getPersonDistance().compareTo( o1.getPersonDistance() ) ); Collections.reverse( personList ); mapPersonAdapter.notifyDataSetChanged(); rv_RecyclerView.setVisibility( View.VISIBLE ); } } } }
基本上是寻找其他人的位置并计算相对于我的距离。
现在,一切正常。
但是,由于隐私限制,我希望尽可能少地保存有关用户的信息。
是否有任何技术可以执行此类计算或推荐算法来查找我周围某个半径范围内的用户,而无需将他们的位置保存到我的 firebase
数据库中?
谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)