views:

30

answers:

1

I am trying to create a tic - tac - toe type of game where two androids can play with each other. I am trying to build this game using eclipse SDK and a servlet written in PHP (or I can use Java if needed). The diagram is attached ( http://www.scorechase.com/tictactoe.PNG ) which depicts one side of the data flow. Here is the problem

1] How do I identify the two emulators? 2] When the device 1 sends an "X" to the servlet, how do I push the message to device 2 so that the message gets populated on device 2.

I did this long back in J2ME where I used the push API to push the data after the devices registered a listener on the servlet. I am not sure how to achieve this in Android. Any ideas will be really helpful.

Thanks!

A: 

Hi

Webdzinez

To use it, an app on the Android device registers with Google, and gets back a registration ID. It then sends that ID to the webapp - via whatever mechanism it chooses. To send a message to the device, the webapp sends an authenticated message to the Android push API, which takes care of delivering it to the device. The push messages themselves consist mostly of a notification of new data, so it's up to the app to actually fetch the new data directly from the webapp.

Push API in android is to be used

success_anil
Thanks ... can you give me a link to the push API ... I ahve been trying to locate it but no luck . Also how do I get this working on emulators. I dont have an Android device yet. Can emulators register with google as well ?
Webdzinez
When I tried to look at the Android_ID to uniquely identify two emulator instances, I get null. So I am confused. Please help
Webdzinez
Well the Android ID will give null in emulator. For each emulator instance ... you can set System.setProperty ("ANDROID_ID",valueID); and then use can use it ...
success_anil