开发者

Android 2 emulators communicating

开发者_如何学CI am new to android and want to create a simple game between 2 emulators.

Emulator 1 can send a string to emulator 2 and emulator 2 can send a string back to emulator 1.

Please can someone advise me on how to go about this as I have no idea.

Thanks.


To run 2 emulators at the same time, I would recommend running them both as virtual sessions (like in VMWare) and "bridge" the connections. Make sure you have static IP addresses for each VM.

As you're simply sending text between them, I would stick to HTTP at this stage just to get the proof-of-concept working. Just don't complicate your life too early. Http should be the easiest common denominator to work with for Wifi or Mobile carriers for now.

If you abstract the object model appropriately, you can later use other communication protocols by overriding the classes. The networking component should be transparent to the application.


You can have direct communication using SMS (just use the emulator port number as phone number to test it) or Bluetooth. If you use Wifi or Mobile phone network, then you must have both devices connected to your server, you cannot have direct connection, or even if in some cases maybe you can, then you should not relay on this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜