简体   繁体   English

我可以使用 WiFi 在两部未连接路由器的 android 手机之间传输数据/消息吗?

[英]Can I use WiFi to transfer data/messages between two android phones, not connected to a router?

I'm aware that if two Android phones are connected to a same wifi network, they can implement socket programming to transfer data between them But I actually want to know if you can use wifi as a transfer medium between two Android phones, just like you Bluetooth?我知道如果两部 Android 手机连接到同一个 wifi 网络,它们可以实现套接字编程以在它们之间传输数据但我实际上想知道您是否可以像您一样使用 wifi 作为两部 Android 手机之间的传输介质蓝牙?

For faster transmission of data over wifi can be done by using "WifiDirect" 
which is a "p2p" connection. so that this will transfer the data from 
one to other device without an Intermediate(Socket). For Example catch 

this link in google developers wifip2p and P2P Connection with Wi-Fi这个链接在谷歌开发者wifip2pP2P Connection with Wi-Fi

Catch a sample in Github WifiDirectFileTransfer在 Github WifiDirectFileTransfer中捕获样本

You can try to use ad-hoc networking on one phone (which has to be Android 2.2.+) to create a Wi-Fi hotspot and connect with the second phone to that.您可以尝试在一部手机(必须是 Android 2.2.+)上使用 ad-hoc 网络来创建 Wi-Fi 热点并与第二部手机连接。 I'm not sure if theres an API yet, I believe not.我不确定是否还有 API,我相信没有。 This question may help, altough it's not recommmend (See the comments in that question). 这个问题可能会有所帮助,尽管不推荐(请参阅该问题中的评论)。

With Android 2.2+ it is possible to create a WiFi hot-spot on one device so another device can connect.使用 Android 2.2+ 可以在一个设备上创建 WiFi 热点,以便另一个设备可以连接。 Internet connection on either device is not required.任一设备上的 Internet 连接都不是必需的。

What you are looking for is ad-hoc wireless networking , which is not well supported on the Android platform.您正在寻找的是ad-hoc 无线网络,它在 Android 平台上没有得到很好的支持。 (but some people have bravely rooted their phones and enabled the functionality) (但有些人勇敢地扎根手机并启用了该功能)

As an alternative, some builds of Android (rooted or not) will support WiFi hotspot functionality.作为替代方案,Android 的某些版本(无论是否根植)将支持 WiFi 热点功能。 Not all carriers will enable this.并非所有运营商都会启用此功能。

Possible duplicate question .可能重复的问题

暂无
暂无

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

相关问题 连接两部Android手机,通过WIFI在他们之间传输数据 - Connecting two Android phones to transfer data between them over WIFI 两部Android手机之间的数据传输 - Data transfer between two android phones 使用Wifi在两个Android之间传输数据 - Transfer data between two Android using Wifi 我可以使用Android的Wifi P2P Api在应用之间传输SQLite数据吗? - Can I Use Android's Wifi P2P Api To Transfer SQLite Data Between Apps? 如何使用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 使用USB主机Api在两部Android手机之间传输数据 - Transfer Data between two android phones using Usb host Api 尝试在两部Android手机之间设置服务器/客户端,而其中一部充当Wifi AP,而另一部则连接到它 - Trying to set up server/client between two Android phones when one is acting as a Wifi AP and the other is connected to it 使用短信通过Android应用程序在两部手机之间进行通信 - Use of text messages to communicate between two phones through android application 如何在本地无线网络中的两部电话之间传输数据以进行测试? - How can I transfer data between two phones in a local wireless network for testing? 通过Wifi在2部Android手机之间发送数据 - Sending Data Between 2 Android Phones Via Wifi
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM