Android的2模拟器通信 [英] Android 2 emulators communicating

查看:86
本文介绍了Android的2模拟器通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Andr​​oid,并希望2仿真器之间创建一个简单的游戏。

I am new to android and want to create a simple game between 2 emulators.

仿真器1可以发送一个字符串到仿真器2和模拟器2可以发送一个字符串返回到模拟器1。

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.

感谢。

推荐答案

要运行2仿真器在同一时间,我会建议为虚拟会话(如在VMWare)和桥梁连接运行它们。请确保您有静态IP地址为每个虚拟机。

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.

当你只是他们之间发送文字,我会坚持到HTTP在这个阶段只是为了让概念验证的工作。只是不要太早复杂的生活。 HTTP应该是最简单的共同点与支持WiFi或移动运营商工作了。

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.

这篇关于Android的2模拟器通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆