实时共享GPS位置 [英] Real time sharing of GPS location
问题描述
我在android世界很新.我想知道如何获得朋友的位置并将其显示在地图上.更确切地说,我不知道该如何分享我和我的朋友的位置.也许必须使用服务器或类似的服务器?
I'm pretty new in the android world. I am wondering how can I get the position of my friends and display it on a map. More precisely, I don't know how to share the position of my friends and I. Maybe have to use a server or something like that ?
难编码吗?
Thx,
Arnaud
推荐答案
您可以查看现有的开源解决方案.
You can look at existing open source solutions.
这是服务器端源代码: https://github.com/tananaev/traccar/
Here is a server side source code: https://github.com/tananaev/traccar/
这是Android应用程序: https://github.com/tananaev/traccar-client-android
And here is Android app: https://github.com/tananaev/traccar-client-android
通信是通过TCP连接完成的.
Communication is done over TCP connection.
- 建立连接后,客户端发送标识消息:
$ PGID,123456789012345 * 0F \ r \ n ,其中123456789012345是唯一的设备标识符,在本例中为IMEI
$PGID,123456789012345*0F\r\n where 123456789012345 is a unique device identifier, in this case IMEI
- 然后,客户端以标准NMEA RMC格式按选定的间隔发送位置报告:
$ GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W * 6A
这篇关于实时共享GPS位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!