简体   繁体   English

使用Wifi在两个Android之间传输数据

[英]Transfer data between two Android using Wifi

I'm trying to develop an Android application which have to be able to transfer data/message between two Android mobiles, as a client server connection using their own Wifi, which having no network or routers nearby. 我正在尝试开发一个Android应用程序,该应用程序必须能够使用自己的Wifi作为客户端服务器连接,在两个Android移动设备之间传输数据/消息,而Wifi在附近没有网络或路由器。 I just tried using Tcp program to do this but it fails, its not connecting, I'm getting ConnectException and connection refused. 我只是尝试使用Tcp程序来执行此操作,但是它失败了,无法连接,我收到了ConnectException并且连接被拒绝。

[Edited] Is it possible to achieve this using Android Portable Hotspot integrated with application? [编辑]是否可以使用与应用程序集成的Android Portable Hotspot实现此目的? Is there any tutorial regarding this approach? 是否有关于此方法的教程?

Any Ideas, how to do this? 任何想法,该怎么做? Thanks. 谢谢。

You need to get the two devices networked to each other before you can worry about tcp usage of that network connection. 您需要将两个设备互相联网,然后才能担心该网络连接的tcp使用情况。

If one device is willing to perform access-point like functionality as part of a portable hotspot, and you select that as a wirelss network on the other, you may achieve a network connection between the two that can be used for custom traffic. 如果一台设备愿意作为便携式热点的一部分执行类似接入点的功能,并且选择将其作为另一台设备的无线网络,则可以在两者之间实现可用于自定义流量的网络连接。 Though there are ways the hotspot could be implemented where that would not work. 尽管有一些方法可以在无法解决问题的地方实施热点。 Also of concern, the "client" device will now be sending all of its network traffic through the hotspot device, including not just foreground apps but anything it decides to do in the background. 同样值得关注的是,“客户端”设备现在将通过热点设备发送其所有网络流量,不仅包括前台应用程序,还包括它决定在后台执行的任何操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 连接两部Android手机,通过WIFI在他们之间传输数据 - Connecting two Android phones to transfer data between them over WIFI 使用wifi直接在Android设备之间传输数据? - Transfer Data between Android devices using wifi direct? 两个Wifi设备之间的数据传输 - Data transfer between two Wifi devices 通过wifi在Android设备之间传输数据 - Transfer data between android device over wifi 如何使用Wifi Direct在两部Android手机之间传输文件到Android手机的下载目录而不是程序包目录 - How to Transfer files between two Android phones using Wifi Direct to Download directory of Android phone and not to Package directory 在wifi网络中的两个以上Android设备之间传输数据 - Transfer data between more than two Android devices within a wifi network 我可以使用 WiFi 在两部未连接路由器的 android 手机之间传输数据/消息吗? - Can I use WiFi to transfer data/messages between two android phones, not connected to a router? 在服务器和客户端之间通过android中的wifi传输数据 - Transfer Data over wifi in android between server and clients 如何使用信标在两个Android设备之间传输数据? - How to transfer data between two Android devices using Beacon? 使用USB主机Api在两部Android手机之间传输数据 - Transfer Data between two android phones using Usb host Api
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM