简体   繁体   中英

Android showing users on Map

On iOS I created an application where a user can share his location and other users could see him on the MapView .

I did this by getting the location with a location manager, whenever it changed by x meters, and then wrote the lat/long with a device id to a database using a PHP script. The other user could then press a button to show the locations on a map by retrieving this data from the database.

Now here is my question. First I think this is the way to make a application like this. If you think there is a more efficient way please let me know.

What is the best method to update this data for showing users on the map?

For my iOS app I used a timer which would get the lat/long from the database every 30s or so, but I dont believe this is the most efficient or best method. The app would have to load the data every second even if another user has not changed his position.

Could you also push me in the right direction on how to animate the pin from the old location to the new location?

Thanks in advance.

Because there are no answers I used old method which is using a timer to update the latt / long in my database. Works ok btw but was wondering if there is a better way.

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