How to make an android peer to peer without using intermediate server? [closed]

▼魔方 西西 提交于 2019-11-30 03:43:18

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!