Question

I have to make a project based on server client communication.To elaborate the server first sends a message to the client .On recieving the message the client sends its exact location to the server every 5 seconds .the server meanwhile updates this information on the map and draws this position as lines of displacement. My problem occurs here: How to send message to/from server or client without any money. How the server recieves this information to get the latitude and longitude and how to draw without losing the previous information.

No correct solution

OTHER TIPS

Not a very easy to understand question but if I follow you, you want to push a trigger from server to client (Android) which then begins responding with it's location. What you do with that data on the server is then up to you.

To send a message from server to client you'll need Google Cloud Messaging (GCM): http://developer.android.com/google/gcm/index.html

This enables you to "push" a short instruction from server to registered Android device. Upon receiving this push your Android device should start a Service which will connect to a location listener and send updates to the server via REST.

I suggest you look at the example in GCM demo mentioned in the link above. Once you've mastered GCM for sending push messages you can expand your service to report locations: http://developer.android.com/google/play-services/location.html

You'll need server side code for:

  • registering the client device id
  • pushing a message from server to GCM
  • REST webservice to receieve location updates

There are plenty of demos out there for both technologies. This should cover what you're looking for. Good luck.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top