简体   繁体   中英

How to use a server to analyse data between two android devices?

Basically what I would like to do is have two phone in close proximity press a transfer button which will notify a server about both the devices latitude, longitude and unique ID. From here I would like the server to compare the latitude and longitude of both devices to check there within a close proximity of each other. If they are within the accepted proximity range the server will swap the ID's of each device so that they can then retrieve information about each other from a database.

I have been stuck for a while and seen a few options but am unsure about there difficulty of implementation and there capability of performing the required task.

I am using using Android and Firebase and have this mostly done except for the server data analysis as mentioned above. The first idea was to try Firebase Functions as it is simple to integrate with the Firebase database but I have had a hard time finding examples in Typecast to perform the functions I want. The other option I see is to use node js which I know next to nothing about and don't want to invest an unnecessary amount of time into just for it to fail.

I have searched a good amount and haven't managed to find any solutions to fit this criteria so if this question has already been asked and answered please link me to the page.

I know this has already been done by Bump but theirs literally no information available about how there back end worked.

If any of you guys can recommend any solutions to resolve this issue it would be greatly appreciated. If I forgot to mention something or you need more information let know.

Firebase cloud functions + Firebase Database is a good fit to your problem statement.

When the two devices initiate a session, you can create a node(session) on Firebase realtime DB and then have a cloud function listen to changes in a node where the sessions would be created. The Firebase cloud function could then compute the logic about the proximity and swap id's.

Where is that you are stuck?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM