Android 2 模拟器通信

Android 2 emulators communicating(Android 2 模拟器通信)
本文介绍了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 模拟器通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How To Create a Rotating Wheel Control?(如何创建转轮控件?)
How to avoid restarting activity when orientation changes on Android(如何在 Android 上的方向更改时避免重新启动活动)
iOS: How to run a function after Device has Rotated (Swift)(iOS:设备旋转后如何运行函数(Swift))
iOS 8 Rotation Methods Deprecation - Backwards Compatibility(iOS 8 旋转方法弃用 - 向后兼容性)
Screen orientation lock(屏幕方向锁定)
Strange behavior with android orientation sensor(android方向传感器的奇怪行为)