hadi Bastanfar
hadi Bastanfar

Reputation: 11

Making a Android chat app and finding people nearby

Hi everyone I'm in trouble one of my friends asked for a chating Android app which it could find "People Nearby" using this app and first I said yes I can make it but now I'm unable to do. so It's my very first app that I'm making it for someone I wanted to know if "People Nearby" is simple function for an app or it's complicated and hard to make it I've seen this kind of apps like swarm that shows you people nearby but unfortunately I can't find any help or source or tutorial for it the only thing I could find was Google's Nearby Messages which I'm not sure that's what I'm looking for so I would be very happy if you could help me or at least tell me where I can find a help.

Upvotes: 1

Views: 3817

Answers (2)

Ramesh
Ramesh

Reputation: 1287

Server side:

(You can use python flask for this kind of simple requirement If you do not have experience in server side scripting)

Your API's must have.

/register -> Registering user profile (unique id, name, location etc) and save it in database.

/receive_location -> Receive location (lat lang values), update in the user profile and check with all records in your database who is in the radius(defined by you or get this as from user) and return the list of user details to client.

Client side:

Have an IntentService which will post location of the client to the server at certain intervals returns the list of users who are in the radius you define.

User googleApiClient to get the location and server . http://developer.android.com/training/location/retrieve-current.html

Use recycler view to show this result. Send a local broadcast from intent service to tell the activity containing recycler view to update it.

Upvotes: 2

Ravi
Ravi

Reputation: 35569

Basic requirement for this is you must have server where all user data is stored.

  1. You must have all users updated latitude and longitude.
    To get updated latitude and longitude you must call your api at periodic times.
  2. If you want nearby people search you must call api with your current latitude and longitude, then from server and your api must filter all users location and gives you nearby people.

Upvotes: 1

Related Questions