How to find the nearby users with my application? - android

I'm currently developing an android application and now the requirement is to identify the users that are near to me who's using this application. Can anyone help me with this ?
Anyone got any sample code or algorithm ???

You need to collect users Longitude and Latitude then compare users longitude and latitude over server and send result back to users.But the question you asked is vast topic it can't be explain like that but for the better result use Spatial Databse

Related

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.
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.
Basic requirement for this is you must have server where all user data is stored.
You must have all users updated latitude and longitude.
To get updated latitude and longitude you must call your api at periodic times.
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.

How to retrieve the location of another android device?

First of all I would like to mention that this would be done with the consent of all users!
That being said, what I am trying to create is an application where the users would see their location and the location of all the other connected users (latitude and longitude).
I am pretty sure the best way to do that would be to send data to a server and then have each device retrieve that data but I would like to know if there exist other ways of doing this. Or perhaps someone could point me in the right direction on how to create such a system with a server retrieving and sending data to android devices ?
GPS coordinates will do for you. You can get the coordinates and save in server then all the coordinates of a particular device can be retrieved by any connected device.
We have Location and LocationManager in android which shall do the job for you. Read more about these in the Android Developers

How to navigate to location based on given latitude and longitude in Android

I got confused on how to solve this problem.
I need to develop and android application titled 'Local Food Finder'.
in my application, user search a food that they want to eat
my application will give the result by listing all the restaurant that provide the related food.
user can choose the restaurant and user can go to the restaurant by using gps.
I have collect all the restaurant location data (longitude & latitude)
After make some research and study, I think I need to use GPS code.
For now, I already have the location data (latitude and longitude) for every restaurant.
But, I don't know where to place/store the data. Do I need to place it in database? So my application can retrieve the restaurant's location from the database.
And then after that, how can user go to the location using this longitude and latitude? What code I have to use..? I know I have to use Java code but I didn't find the example code...
Someone please help me. I am a android beginner. I really don't know how to settle this.
I would recommend storing the data in https://www.parse.com, because they support geospatial queries. 'give me all reastaurants matching food x near (lat,lon)'.
To get the device position you could use https://github.com/mcharmas/Android-ReactiveLocation. Is the simplest code that I found so far to do so.

Getting near by places

As far as I know, I can get the near by places from user's current location i.e. from latitude and longitude by using google play web service. Can I get the following categorized places. Is there any api to get it? please suggest the solution. Thanks in advance
Tourist attractions
Restaurants Hangouts
Events this week
Weekend Getaways
My sad without some research posted the question. I found the answer to my question on this

android send location details to servlet via gps

i am newbie to Android..i have latitude and longitude details in my program..i want to send them to web server via gps..and those details should be saved in a database and retrieve them whenever i require..plz explain me how to do..and if possible give me some sample code...
Did you mean the mobile network or wireless instead of GPS ?
Anyway:
You from the sounds of it you need to get the GPS details into your program then pass them to your server. Have you designed your webserver yet or are you going to be submitting this to a site that already exists?
You can't "send" something "via GPS". GPS is a "receive-only" thing.
http://en.wikipedia.org/wiki/Global_Positioning_System
If you like to send data to a web server, you can use the HTTP-protocol with Android, e.g. retrieve latitude and longitude (How to get Latitude and Longitude of the mobile device in android?) and then use HttpGet (or HttpPost):
http://developer.android.com/reference/org/apache/http/client/methods/HttpGet.html
You're really asking for a lot, but lets see if we can point you in the right directions.
Here is a great example of reading GPS data from an Android device:
LocationManager example
You must declare explicitly in Android that your app needs permission to access the Internet (and the GPS, for that matter).
Android Securty and Permissions
There are also some specific ways of life in Android development. The official developer's guide is a good place to start.
The Android Developer's Guide

Categories

Resources