I want to make a android app using google maps.In this app I want to share my location to my friend like a request, Once he accepted my request he will get the route map to my location (previously I shared) and also I want to see his moving path towards my location. Can any one please suggest me how is possible to sharing locations.
I think the best way to control that sharing is using socket.IO
on the device you catch your position then emit your position to the server and on the server side you emit to other devices.
Hope helped you
For sharing locations and showing it on map, you need to do it in following steps
Read your location using android APIs.
Once he accepts your request, read his location and share it to your profile through some API to server & keep on updating location on every changed distance delta or at some time interval and share that too.
Now you have co ordinates of both locations. Use them to fill data to Google Maps API and load map in one of your activity. Whenever you will receive updated location of your friend from your server, update the map and draw path between them using google maps api.
For showing map to your location # your friends side, same thing needs to be done. If your location will also change then you will have to provide your updated location to server timely as mentioned in step 2
What if you send a geo: link to your friend? Like geo:62.0,-7.0 ? That should give the receiver a choice between all his geo-capable apps. Google Maps, OsmAnd, maybe some weather service...
Related
I want to put a link to a simple google search in my app. So if I search myself this is the link...
https://www.google.co.uk/maps/search/dog+groomer+near+me/#53.0725236,0.0423795,11.44z
It obviously has my coordinates in it. Is there a way for me to change it to a generic link so it automatically uses the users location?
You will want to use Android's location manager. This will allow you to get the user's coordinates (as long as they have location enabled on their phone.)
https://developer.android.com/guide/topics/location/#location
https://developer.android.com/guide/topics/location/strategies
It is up to you what you do with this. You can do a quick string replace and insert the user's coordinates inside the url. Or you could even include the google maps component into your app and have the results show up right in your app.
I'm new to android Location API and Maps. I was thinking about making an application which can be used to share location of friends and locate them on Google Maps. There are many kinds of apps which exists in the market like Find My Friends by Apple FindMyFriends
The only way which I thought to spot my friends on google maps was to create a database, put their profile information (like name,phone,email-id) and retrieve it back. Is there any other way which is much better than the way I proposed?
Thanks
I had worked on similar projects. I hope my brief info would be helpful to you. You certainly do have to create database and it should be on the server which is accesed by API.
For server part what you need is an REST API which can be created on php , jsp or other. Api handles the request and response data using json(may be other too).
In android its better to use google map api v2 , and use LocationManager or LocationClient classes for getting current location in longitude and latitude format and update it to database by sending request to Api.
I was searching for hours, but I can't find an answer on this topic. I have managed to set up an application which shows my position, tracks it and updates my marker whenever my position changes.
I would like to do the same for all other users (for finding friends), but I don't understand the right way this has to be done.
Should I upload each users Lat and Lng to a server, then downloading it while placing markers on the map? This way I may not get fast location updates, or does the Google Map Api contain some tools to achieve this in the right way?
I would really appreciate some help.
E.
UPDATE
After doing some more resources, I realised that an online database is the way to go for this task.
Steps I made to read save and retrieve users positions:
Create an online (mysql) database
in my android project I have implemented: GooglePlayServicesClient.ConnectionCallbacks,GooglePlayServicesClient.OnConnectionFailedListener. But most important is LocationListener - to receive the current location coordinates each time the user changes position.
I then uploaded the coordinates using the HttpUrlConnection via POST method, and adding them to the database using php.
back in the app I create a new instance of the GoogleMap class, and the same way as I have uploaded I download all other users coordinates via HttpUrlConnection, iterate over the JSON response and placing markers on the map in the same time.
Everything works like it should, there may be other ways but I think this is the most straight forward solution. Hope this small guide will help.
I have seen some applications that display on a map the users who have the application in use or installed.
I'd like to implement something like this in my project, the problem is I do not know where to start ..
anyone know any reference I can read?
This is an image to try to explain what I want
Thanks in advance
Regards
When user installs app, get its location using GPS, send it to your Server save it there.
When you want to show map, get all locations saved on server and display it on map.
You can update user location each time application is launched, updated it on server as well.
I was wondering how I can channel or simulate Google Maps just in the sense of a user types in a location in text, such as a restaurant name and a city name. Then Google suggests 5 or so places they have indexed, and presumably they know the GPS coordinates because Google then puts them on a map. I want to be able to use that feature- not the map, just getting the location.
My goal is for a user to type in a query, 5 options or so to be shown, and if they user chooses one of them, then the GPS coordinates, or a location object, is saved representing that place.
Ideally I could just send the query to Google and steal the results back to my app. Obviously building my own database of locations and an algorithm to suggest them is out of the question.
Thanks for the help and advice in advanced!
Note 1: To clarify, this does NOT involve the current position of the user/device.
Note 2: I looked at the Google Maps add-on API, but it looks like that is for a visual map, not the querying a location part. You are already supposed to know your location, and it will map it.
Use geocoder.getFromLocationName, you get back a list of Address objects, in those objects you will find all the information you need about the location.
To test this on the simulator you need an image with the Google APIs included. In a device should be fine if you have the market installed.