Android 2 emulators communicating(Android 2 模拟器通信)
问题描述
我是 android 新手,想在 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 中)运行并桥接"连接.确保每个 VM 都有静态 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 模拟器通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android 2 模拟器通信


- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01