Android Wi-Fi AP热点 - 没有互联网

时间:2020-12-05 20:07:06

There are lots of post on SO regarding setting up AP (Hotspot) on android mobile. However, in all these cases, the AP is a conduit to the outside internet world. In my case, I just want a server application running over a mobile setup as an AP. And let all the client android mobiles connect to it, send their data and disconnect if they like. No internet connection is assumed (i.e, no gprs/3g etc).

有关在Android手机上设置AP(热点)的SO上有很多帖子。然而,在所有这些情况下,AP是通往外部互联网世界的渠道。就我而言,我只想要一个通过移动设置运行的服务器应用程序作为AP。让所有客户端Android手机连接到它,发送他们的数据并断开连接,如果他们喜欢。没有互联网连接(即没有gprs / 3g等)。

My observations: If I setup a wifi AP (via settings -> tethering and portable hotspots) when it is also connected to GPRS, then another android phone can successfully connect to this AP and send the data to the application. However, if I disable the GPRS, even though the client shows that it is connected to the AP, it can't seem to send any data. It seems that an external internet connection is a necessity for the AP mode to work.

我的观察:如果我设置了一个wifi AP(通过设置 - >网络共享和便携式热点),当它也连接到GPRS时,另一个Android手机可以成功连接到该AP并将数据发送到应用程序。但是,如果我禁用GPRS,即使客户端显示它已连接到AP,它似乎也无法发送任何数据。似乎外部互联网连接是AP模式工作的必要条件。

Is this understanding correct? Or am I setting something wrong?

这种理解是否正确?或者我说错了什么?

3 个解决方案

#1


0  

I think you have used the internet IPs in your code not the local IPs for communications,is'nt it?

我认为您在代码中使用了互联网IP而不是本地IP进行通信,不是吗?

#2


0  

I have the same use case and was looking for the same info as you are. I checked that some of the WiFi-only tablets do not even have a HotSpot setting. Even the devices that do have it, if I remove the SIM card, I cannot enable the HotSpot (I get a message asking me to insert a SIM first).

我有相同的用例,并且正在寻找与您相同的信息。我检查了一些仅限WiFi的平板电脑甚至没有HotSpot设置。即使是拥有它的设备,如果我移除SIM卡,我也无法启用HotSpot(我收到一条消息,要求我先插入SIM卡)。

It looks like our use case is not supported by Android. Rather, the HotSpot feature was not designed with our use-case in mind. I mean, why would an end-user want to use an Android phone or tablet in a HotSpot mode if it didn't also provide outside connectivity?

看起来我们的用例不受Android支持。相反,HotSpot功能并未考虑我们的用例。我的意思是,如果最终用户不提供外部连接,为什么要在HotSpot模式下使用Android手机或平板电脑?

#3


0  

I know that I am late to the party (more than 3 years late :) but I was searching for a solution to this problem and stumbled upon an easy workaround. I am using a Nexus 4 with Android 5.0.1 and I can easily configure my phone to use it as an Android Wi-fi AP hotspot - without internet. Just go to Settings / Data Usage and disable "Mobile data" option under the Mobile tab. Then enable the WiFi hotspot option as usual.

我知道我迟到了(已经晚了3年多了:)但我正在寻找解决这个问题的方法,偶然发现了一个简单的解决方法。我正在使用带有Android 5.0.1的Nexus 4,我可以轻松配置我的手机,将其用作Android Wi-Fi AP热点 - 无需互联网。只需转到“设置/数据使用”并禁用“移动”选项卡下的“移动数据”选项。然后像往常一样启用WiFi热点选项。

I was trying to get this working in order to play with a VirtualBox machine from VulnHub.com that asked for a Bridged Connection when I was commuting to work (no Internet, but with my laptop and my mobile phone I was able to make it :)

我试图让这个工作,以便使用来自VulnHub.com的VirtualBox机器,当我上下班时要求桥接连接(没有互联网,但我的笔记本电脑和我的手机,我能够做到: )

#1


0  

I think you have used the internet IPs in your code not the local IPs for communications,is'nt it?

我认为您在代码中使用了互联网IP而不是本地IP进行通信,不是吗?

#2


0  

I have the same use case and was looking for the same info as you are. I checked that some of the WiFi-only tablets do not even have a HotSpot setting. Even the devices that do have it, if I remove the SIM card, I cannot enable the HotSpot (I get a message asking me to insert a SIM first).

我有相同的用例,并且正在寻找与您相同的信息。我检查了一些仅限WiFi的平板电脑甚至没有HotSpot设置。即使是拥有它的设备,如果我移除SIM卡,我也无法启用HotSpot(我收到一条消息,要求我先插入SIM卡)。

It looks like our use case is not supported by Android. Rather, the HotSpot feature was not designed with our use-case in mind. I mean, why would an end-user want to use an Android phone or tablet in a HotSpot mode if it didn't also provide outside connectivity?

看起来我们的用例不受Android支持。相反,HotSpot功能并未考虑我们的用例。我的意思是,如果最终用户不提供外部连接,为什么要在HotSpot模式下使用Android手机或平板电脑?

#3


0  

I know that I am late to the party (more than 3 years late :) but I was searching for a solution to this problem and stumbled upon an easy workaround. I am using a Nexus 4 with Android 5.0.1 and I can easily configure my phone to use it as an Android Wi-fi AP hotspot - without internet. Just go to Settings / Data Usage and disable "Mobile data" option under the Mobile tab. Then enable the WiFi hotspot option as usual.

我知道我迟到了(已经晚了3年多了:)但我正在寻找解决这个问题的方法,偶然发现了一个简单的解决方法。我正在使用带有Android 5.0.1的Nexus 4,我可以轻松配置我的手机,将其用作Android Wi-Fi AP热点 - 无需互联网。只需转到“设置/数据使用”并禁用“移动”选项卡下的“移动数据”选项。然后像往常一样启用WiFi热点选项。

I was trying to get this working in order to play with a VirtualBox machine from VulnHub.com that asked for a Bridged Connection when I was commuting to work (no Internet, but with my laptop and my mobile phone I was able to make it :)

我试图让这个工作,以便使用来自VulnHub.com的VirtualBox机器,当我上下班时要求桥接连接(没有互联网,但我的笔记本电脑和我的手机,我能够做到: )