如何将 Android wifi 连接到 adhoc wifi?
我是android系统的新手。 这是正确的吗,android 2.2.1 WIFI 仅检测非 ad hoc 无线网络? 我想知道是否有一种方法可以将我的 Android 从我的笔记本电脑连接到临时网络设置。
I'm new on the android system.
Is this correct, the android 2.2.1 WIFI only detects non-ad hoc wireless network?
I was wondering if there's a way to connect my android to an ad hoc network set-up from my laptop.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
你是对的,Android 目前并没有原生支持这一点,尽管 Google 自从 Android 正式推出以来就一直表示将会支持这一功能。
虽然本机不支持,但迄今为止发布的每台 Android 设备上的硬件都支持它。它只是在软件中被禁用,您需要启用它才能使用这些功能。
然而,做到这一点相当容易,但你需要 root,并且不同设备之间的具体细节可能略有不同。有关详细信息的最佳来源是 XDA 开发人员:http://forum .xda-developers.com/forumdisplay.php?f=564。
大多数现有解决方案都是基于替换 wpa_supplicant,如果可能的话,我会在您的设备上推荐这种方法。有关更多详细信息,请参阅 http://szym.net/2010/12/adhoc -wifi-in-android/。
更新:已经过去几年了,每当我需要手机上的临时网络连接时,我都会使用CyanogenMod.它使您能够以编程方式和脚本方式访问这些功能,并能够在 WiFi 设置菜单中创建临时 (ibss) 网络。
You are correct that this is currently not natively supported in Android, although Google has been saying it will be coming ever since Android was officially launched.
While not natively supported, the hardware on every android device released to date do support it. It is just disabled in software, and you would need to enable it in order to use these features.
It is however, fairly easy to do this, but you need to be root, and the specifics may be slightly different between different devices. Your best source for more informationa about this, would be XDA developers: http://forum.xda-developers.com/forumdisplay.php?f=564.
Most of the existing solutions are based on replacing wpa_supplicant, and is the method I would recommend if possible on your device. For more details, see http://szym.net/2010/12/adhoc-wifi-in-android/.
Update: Its been a few years now, and whenever I need an ad hoc network connection on my phone I use CyanogenMod. It gives you both programmatic and scripted access to these functions, and the ability to create ad hoc (ibss) networks in the WiFi settings menu.
如果您特别想使用临时无线网络,那么Andy的答案似乎就是您的选择唯一的选择。但是,如果您只是想使用任何必要的方式通过 Wi-fi 共享笔记本电脑的互联网连接,那么您至少还有两个选择:
*某些搭载 Android 2.3 的手机具有支持 Wi-fi Direct 的专有操作系统扩展(主要是较新的三星手机),但 Android 4 应该完全支持此功能 (来源)。
If you specifically want to use an ad hoc wireless network, then Andy's answer seems to be your only option. However, if you just want to share your laptop's internet connection via Wi-fi using any means necessary, then you have at least two more options:
*Some phones with Android 2.3 have proprietary OS extensions that enable Wi-fi Direct (mostly newer Samsung phones), but Android 4 should fully support this (source).
如果您有 Microsoft 虚拟 WiFi 微型端口适配器作为可用网络适配器之一,则可以执行以下操作:
netsh wlan set Hostednetwork mode=allow ssid=NAME key=PASSWORD
netsh wlan startHostednetwork
netsh wlan stop Hostednetwork
就这样!
来源:如何在不使用软件的情况下将 Android 手机连接到 ad-hoc 网络。
If you have a Microsoft Virtual WiFi Miniport Adapter as one of the available network adapters, you may do the following:
netsh wlan set hostednetwork mode=allow ssid=NAME key=PASSWORD
netsh wlan start hostednetwork
netsh wlan stop hostednetwork
That's it!
Source: How to connect android phone to an ad-hoc network without softwares.
我确实注意到了一些有趣的事情:在我的 2.3.4 手机中,我在“设置”>“设置”中看不到 AP/AdHoc SSID。无线与网络菜单。在运行 4.0.3 的 Acer A500 上,我确实看到了它们,前缀为 (*)
但是,在我改编的以下代码中(不记得来源,抱歉!),我确实看到 Ad Hoc 出现在 Wifi 中在我的 2.3.4 手机上扫描。我仍然希望实际连接并创建一个套接字+输入/输出流。但是,请注意:
不要忘记在 Eclipse 中您可以使用 Ctrl+Shift+[字母 O] 来填写缺少的导入...
以及我的清单:
希望有帮助!
I did notice something of interest here: In my 2.3.4 phone I can't see AP/AdHoc SSIDs in the Settings > Wireless & Networks menu. On an Acer A500 running 4.0.3 I do see them, prefixed by (*)
However in the following bit of code that I adapted from (can't remember source, sorry!) I do see the Ad Hoc show up in the Wifi Scan on my 2.3.4 phone. I am still looking to actually connect and create a socket + input/outputStream. But, here ya go:
Don't forget that in Eclipse you can use Ctrl+Shift+[letter O] to fill in the missing imports...
and my manifest:
Hope that helps!
你是对的,但请注意,你可以用相反的方式做到这一点 - 使用 Android Wifi 网络共享将手机设置为基站并从笔记本电脑连接到所述基站。
You are correct, but note that you can do it the other way around - use Android Wifi tethering that sets up the phone as a base station and connect to said base station from the laptop.