I have a project where I have to create the Web APi for Android on Real time tracking of app.
How can I implement the real time tracking and if one device send (Post()) the data say latitude and longitude. So where I store that lat and long So if and another device ask (Get()) for that data I can return that.
Related
In my app, I am already sending the current location of a bus(basically a device) to the server. This data sending is happening each 5 mins.
Now I am developing another module of the app where I want to show that bus location. So, I need to fetch the bus location every 5 mins from server and display the location in Google Map in Android. This should be like Uber bus tracking ( I mean seamless). Can someone share me a sample code for that?
Thanks,
Arindam
I'm developing a tracking system between two users using android where both have their own android device, this application should work as follow:
the first user's android device has to discover its current location (latitude and longitude).
the user's location (latitude and longitude) has to be uploaded into a database periodically and continuously once the user's location is changed.
the second user's android device retrieves these latitudes and longitude and then displays the first user's location on a googleMap based on them.
I can discover the user's current latitude and longitude for once easily and the database is prepared to receive them and everything is fine, but how to discover them once they changed and keep uploading them into the database continuously ??
In addition to above comments as they perfectly gets user location and for sending location to database use firebase realtime database (you can try it for free) and like a chatting app send users location periodically and receive the same in others mobile by getting the Json from realtime database.
Moreover if you want to limit it between 2 users assign the user same topic"". For more information please deep dive into firebase.
There is an overriden method called onLocationChanged in LocationListener which provides us latest Location whenever user place gets changed.
Reference: LocationListener guidelines
Hope this will help.
Put the same code of fetching current location in onLocation changed. That will automatically update the values every time when change is there in position.
I'm trying to develop a system that's able to map routes and track vehicles on the routes. The vehicles would be equipped with a raspberry pi and a gps module that would send the gps location long lat to a web server. From there I want to be able to show the mapped tracks and the position of the vehicle in an android phone. I want to show the approximate time of arrival of the vehicle to the next marker on the map.
It's like the uber interface of seeing the driver, it's path and the estimated time of arrival but with a fixed path that the tracked vehicle travels (it doesn't disappear) and the ETA for different markers on the map. What I'm trying to develop it's an app that can be used on android to facilitate travel in city busses. It shows the route and shows the bus ETA to the next bus stop (the marker).
Main questions:
How do I recollect the long/lat from the server from the android app
utilizing the google maps api?
Should I take another approach to this? what do you suggest?
Any suggestions changing the hardware (rpi with module) to another one?
How do you recommend I should develop this?
Thanks for your time and suggestions.
I made a similar app, I used to send lat/long, time and id (one unique Id per bus) to my sql server. Then on the app I make a request on my server to get my data (I get a Json like this :
{lat:48.23,long:2.65,time:1488815476,id:F12B35}
So you have the location of your bus at the time t.
I don't recommand you a raspberry, i think an arduino would be better if ou want to send your data to your server by GSM/GPRS for example.
I'm looking to implement, real time location tracking for android apps.
The server would request a specific device's real time location which needs to be shown on google map. can anyone help me with this.
Thanks
use geo coding google api to do this stuff.... through gps in android write a android app, that should send latitude and longitude position for every 10 or 20sec so that you can make a variable for latitude and longitude so that new value get updated and stored
I am trying to make a small application using the Google Maps API.
It will display every fastfood location in an area. I know there are already some applications that do the same thing, but I would like to learn and do my own stuff :).
E.g. I have a list of 1000 address, and I would like for every of them to be displayed on the map. S
Should my application send requests 1000 times to Google the longitude and latitude of the location for each time a user would want to use my application?
Or should I store the longitude and the latitude on my database? If so, is there a way to obtain them through a request? I know there is a way to obtain it one by one, not to have all of them.
The Geocoder API has a request limit per API key (you have to obtain one of those): 2500 calls or so per day. I would suggest you use the Geocoder to obtain the Lat and Lon of all your adresses and save them to SQLite, so you can reuse the locations all the time.
Just write a loop that goes through all your adresses, makes the request to google and stores the lat/lon information. If you hit their limit, you can continue the next day.