just finished reading the GCM evaluation report. VERY well constructed.
I do however, challenge one point in the dissertation; specifically, Turkish cellular infrastructure. I was stationed in Turkey and know the terrain/topography will interfere with cell transmission. There is little regulation regarding building height (new construction) when considering existing towers and line-of-sight placement.
That being said, I would like to try your suggestion Computersmith64! If you have code to share I would love to learn from it and try a base-line test!
Best,
-Doyle
I didn't read the whole thing, but from the conclusion I got the impression that the non-delivery of messages is not necessarily related only to network stability. I have read other comments online that suggest there is an inherent reliability issue with GCM message delivery.
If I was using FCM / Google Maps for an app like this (based on your description in the original post), I would make the app user-definable as either a client or server. In your case (& to be consistent with the way FCM works), you would have multiple "servers" (the guys out in the field) & 1 "client" (the master app). Both variations would have Maps running & the servers would be sending their current position to a FCM topic that the client is subscribed to. When a message arrives, the client would plot that position on the map, along with any other information contained in the message (like the crew member's name). You would configure the app to send a message every (x) seconds (using a timer) or based on distance moved (calculated from GPS positions).
There is a very good tutorial on how to implement Google Maps in your app here ->
Google Maps. This is what I used to get me started.
To construct an FCM message with the relevant data you could do something like this (replace gmap with whatever your GoogleMap object is declared as):
Private Sub sendLocationMessage
Private Job As HttpJob
Private jg As JSONGenerator
Private m As Map = CreateMap("to": $"/topics/fieldpositions"$)
Private data As Map = CreateMap("sendername": "Dave", "lat": gmap.MyLocation.Latitude, "lon": gmap.MyLocation.Longitude)
m.Put("data": data)
Job.Initialize("fcm", Me)
jg.Initialize(m)
Job.PostString("https://fcm.googleapis.com/fcm/send", jg.ToString)
Job.GetRequest.SetContentType("application/json")
Job.GetRequest.SetHeader("Authorization", "key=" & Starter.API_KEY)
End Sub
Sub JobDone(job As HttpJob)
Log(job)
If job.Success Then
Log(job.GetString)
End If
job.Release
End Sub
When the message arrives at the other end, you can place a marker on the map:
'In FirebaseMessaging Service
Sub fm_MessageArrived (Message As RemoteMessage)
CallSub2(Main, "updateMap", Message)
End Sub
'In Main Activity
Public Sub updateMap(msg As RemoteMessage)
Private lat As Double = msg.GetData.Get("lat")
Private lon As Double = msg.GetData.Get("lon")
Private m1 As Marker = gmap.AddMarker2(lat, lon, msg.GetData.Get("sendername"), gmap.HUE_RED)
'If you then want the map to pan & zoom to the latest marker added
pos.Initialize(lat, lon, markerZoom)
gmap.AnimateCamera(pos)
End Sub
That's basically it in terms of the mechanics of sending & receiving positions, then plotting them on a map. In the FCM message you can put whatever labels & messages you want, by adding them to your "data" map - so if you want to give your users the option of sending a position manually with a message, you can just add a "message": msg pair to the map.
- Colin.