查找附近的应用用户(iPhone 和 Android) [英] Find nearby users of an app (iPhone and Android)

查看:26
本文介绍了查找附近的应用用户(iPhone 和 Android)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个具有 iPhone 版本和 Android 版本的应用程序.

I am working on an app that has an iPhone version as well as an Android version.

我的目标是……

  • 显示我的应用附近的用户列表(iPhone 应用用户和 Android 应用用户).假设列出当前在 1 英里或 2 英里半径范围内且当前正在使用我的应用的用户.
  • 此列表将同时显示在 iPhone 应用和 Android 应用上.
  • 当用户点击刷新按钮时,应用会更新列表.

我的问题是……

  • 实现上述目标的最佳方式是什么?我是否需要定期将所有应用用户的当前 GPS 位置从他们的 Droid 和 iPhone 发送到我们的网络服务器?

为了让我的问题更清楚......

To make my question more clear...

  • 我有一个算法可以找出给定范围(1 英里或 2 英里半径等)内的地点/用户,所以请不要告诉我如何找到给定范围内的用户.
  • 我知道如何获取 iPhone 和 Droid 设备的当前位置,所以请不要告诉我如何获取 iPhone 或 Android 设备的最新位置.
  • 我知道这是一个隐私问题.因此,应用会请求用户允许将他们的位置发送到我们的网络服务器,因此请不要告诉我用户或 Apple 可能存在的隐私问题.
  • 告诉我如何在网络服务器上最好地维护我的应用用户的地理位置更新列表?经验证的最佳方法!
  • 如果我的问题还需要澄清,请告诉我.
  • I have an algorithm to find out the places/users within a given range (1 mile or 2 miles radius etc), so PLEASE DON'T TELL ME how to find users within a given range.
  • I know how to get current location of iPhone and Droid devices, so PLEASE DON'T TELL ME how to get updated location of an iPhone or Android device.
  • I know that this is a privacy issue. Therefore app will ask for user's permission to send their location to our web server, so PLEASE DON'T TELL ME about privacy concerns users or Apple may have.
  • JUST TELL ME how to best maintain updated list of Geo Locations of my app users on the web server? The best, proven approach!
  • Let me know if my question still needs clarification.

感谢和问候

推荐答案

即使我今天在创建类似的应用程序时也有这个问题.两个用户/朋友靠近时发出警报彼此 - Android Proximity

Even i had this question on my mind today while creating similar app. Alert when two users/friends are near to each other - Android Proximity

经过几个小时的思考,我想到了一个更好的方法:

after spending a couple of hours thinking, I thought a better way to do this :

1) 创建 SharedPreference/DB,其中包含设备的最后一个坐标,该坐标也已更新到服务器.

1) Create SharedPreference / DB which holds the last Coordinates of the device which was also updated to the server.

2) 创建将在 15 分钟内触发一次请求当前位置的服务.

2) Create Service which will fire once in 15 minutes requesting current location.

3) 如果当前位置与从 SharedPreference 检索到的最后一个位置相匹配,或者在附近(取决于你给 30 英尺或更多),那么用户在同一个地方 所以不要上传坐标到服务器.

3) If the current location matches the Last Location retrieved from the SharedPreference and or around within proximity (depends on how much u give 30ft or more) then user is in the same place so don't upload the coordinates to the server.

4) 如果用户不在附近或上一个位置与当前位置不匹配,则将坐标上传到服务器.

4) If the user isn't within proximity or last location doesn't match current location then upload the coordinates to the server.

5) 将坐标上传到服务器后,也更新 SharedPreference..

5) After uploading coordinates to the server, update SharedPreference too..

6) 上传后,从服务器返回相同坐标附近的用户详细信息的响应.如果周围有人,用户将收到通知..

6) After uploading, return response of Users details from the server who are nearby the same coordinates. The User will then get notified if someone around them..

这篇关于查找附近的应用用户(iPhone 和 Android)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆