Adobe AIR, which can run on Android 2.2+ devices can use a (fledgling) technology called Adobe Cirrus (used to be Stratus) which makes p2p possible.
If you would prefer to use Java and create your own p2p system, you might like to take a look at this project: peerdroid
However, I don't have any experience using either of these on Android, and you are likely to encounter issues, especially if it needs to work reliably behind NAT routers.... Good luck!
I should also point out that it would be way easier, simpler and (unless your app is huge or very special) - cheaper, to do this the traditional way, with a server in between.
What you're looking to do is "ad-hoc communication" between devices. Android doesn't have that enabled by default but some people claim they have created libraries that do it. Look around stackoverflow and you'll figure out what's going on.
From Android 4.0, Android provides a Wi-Fi Peer-to-Peer framework, no need for an external library. This Peer-to-Peer is meant for a connection over the air between two Android devices, i.e. not through the Internet. However, this is relatively low-level, as you have to deal with sockets directly.
发布评论
评论(3)
Adobe AIR 可以在 Android 2.2+ 设备上运行,可以使用名为 Adobe Cirrus(以前是 Stratus)的(新兴)技术,该技术使 p2p 成为可能。
如果您更喜欢使用 Java 并创建自己的 p2p 系统,您可能想看看这个项目:peerdroid
但是,我没有在 Android 上使用这两者的任何经验,并且您可能会遇到问题,特别是当它需要在 NAT 路由器后面可靠地工作时......祝您好运!
我还应该指出,使用传统方式(中间有服务器)会更容易、更简单并且(除非您的应用程序很大或非常特殊)更便宜。
Adobe AIR, which can run on Android 2.2+ devices can use a (fledgling) technology called Adobe Cirrus (used to be Stratus) which makes p2p possible.
If you would prefer to use Java and create your own p2p system, you might like to take a look at this project: peerdroid
However, I don't have any experience using either of these on Android, and you are likely to encounter issues, especially if it needs to work reliably behind NAT routers.... Good luck!
I should also point out that it would be way easier, simpler and (unless your app is huge or very special) - cheaper, to do this the traditional way, with a server in between.
您想要做的是设备之间的“临时通信”。 Android 默认情况下没有启用此功能,但有些人声称他们已经创建了可以执行此操作的库。环顾一下 stackoverflow,你就会明白发生了什么。
What you're looking to do is "ad-hoc communication" between devices. Android doesn't have that enabled by default but some people claim they have created libraries that do it. Look around stackoverflow and you'll figure out what's going on.
从 Android 4.0 开始,Android 提供了 Wi-Fi 点对点框架,不需要外部库。这种点对点用于两个 Android 设备之间的无线连接,即不通过互联网。但是,这是相对较低级别的,因为您必须直接处理套接字。
From Android 4.0, Android provides a Wi-Fi Peer-to-Peer framework, no need for an external library. This Peer-to-Peer is meant for a connection over the air between two Android devices, i.e. not through the Internet. However, this is relatively low-level, as you have to deal with sockets directly.