简体   繁体   中英

Android Wi-fi AP hotspot - without internet

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 (ie, no gprs/3g etc).

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.

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

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.

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 :)

我认为您在代码中使用的是Internet IP,而不是本地IP,不是吗?

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).

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM