Dazzler
Dazzler

Reputation: 382

Sending Coordinates to Google App engine

I am working on an android side project where I have set up my website on google Cloud platform, I am also using Google App engine and setup my database on Google Datastore.

My website consists of a map where I can create fences and send the coordinates of the fences to the app. I have maps activity on my android app and I am trying to figure out how to send the GPS location / coordinates of the mobile to the server every few mins.

So that the I can be able to see the location of the mobile on my website map. It is basically how to track a user. Can anyone please let me know if there is a way to do this? Thanks.

Upvotes: 0

Views: 176

Answers (1)

AniV
AniV

Reputation: 4037

You have two options here that are independent of the underlying architecture you are using currently:

  • Polling
  • Sending Broadcast

In the first strategy the server (Google App Engine) shall poll the mobile devices at specific time interval. You can find the code for that easily online in the choice of your language. This would fetch the location of the mobile devices which you can store in the datastore and display on the map of your website.

In the second strategy you can put the sendBroadcast() code/method in your android code. This would enable the device to send the location to the server and you can store them in the datastore and display them on the map.

Hope this Helps!!

Upvotes: 1

Related Questions