Someone Somewhere
Someone Somewhere

Reputation: 23787

for multiplayer online game: how to initiate data transfer by server and send data to android phone?

I'm very familiar with REST type of communication where the phone sends GET and POST messages to the server - essentially polling the server for updates. This worked well for apps where real-time data wasn't essential.

For a multiplayer game real-time data is essential; after a user has signed-in to the server the server needs to be able to send messages to the phone (instead of the phone asking for data).

Does anyone have any links to provide details on how this is done ?

Upvotes: 3

Views: 1937

Answers (2)

Someone Somewhere
Someone Somewhere

Reputation: 23787

Thanks to Selvin for pointing me to the "socket" keyword.

I've searched around and came up with the following online resources :

Incorporating Socket Programming into your Applications http://thinkandroid.wordpress.com/2010/03/27/incorporating-socket-programming-into-your-applications/

Example: Android bi-directional network socket using AsyncTask Example: Android bi-directional network socket using AsyncTask

If anyone has a book suggestion, please let me know with a comment.

Upvotes: 3

mbwasi
mbwasi

Reputation: 4297

You will need to implement Android Cloud to Device Messaging, Android's push technology, available on Android 2.2 and above. http://android-developers.blogspot.com/2010/05/android-cloud-to-device-messaging.html

Upvotes: 0

Related Questions