简体   繁体   English

Android Google Maps上的车辆位置追踪器

[英]Vehicle location tracer on android google maps

I am building an project which tracks vehicle location on android google maps. 我正在建立一个在Android谷歌地图上跟踪车辆位置的项目。 Vehicle will be using SIM 808 module to track the location and send it to server, but what to do next and how to do this task ? 车辆将使用SIM 808模块来跟踪位置并将其发送到服务器,但是下一步该怎么做以及如何完成此任务?

You have the option to implement one of the 2 methods : 您可以选择实现以下两种方法之一:

  • Push Notifications with Broadcast receivers : Your server gets the current location and sends it to your phone through FCM (Firebase Cloud messaging), you're listening on your app for push notifications with the BroadCast Receiver and once a new location comes, you update the location marker on your map. 广播接收器的 推送通知 :您的服务器获取当前位置,并通过FCM(Firebase Cloud消息传递)将其发送到手机,您正在使用BroadCast Receiver监听应用程序中的推送通知,一旦有了新位置,便会更新地图上的位置标记。
  • Long polling : which is simply a periodic HTTP request that you fire to your backend location service (every 10 seconds for example) and after each call you update the location marker on the map. 长轮询 :这只是一个定期HTTP请求,您可以向后端定位服务触发(例如,每10秒一次),并且在每次调用后更新地图上的位置标记。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM