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 target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)