Android Question (Solved) Using the phone's wifi as a AP. (NOT Hotspot)

Similar threads

B4A Code Snippet Start Local Hotspot
B4A Tutorial B4A-Bridge over wifi without a local network
B4A Code Snippet Access Wifi Information
B4A Question Share txt files
B4A Question Mqtt chat network error

Jaco vd Walt

Member
Licensed User
I would like to use the phone as a ftp server. For this to work I need to be able to put the wifi in AP mode. This is quite easy on raspbian with hostapd, however it would help me a lot if I could get this working on Android. I am suspecting that this mode is not possible on Android non Rooted devices.

So just to be clear, I want to switch the wifi radio on the phone to access mode (No internet needed). Then when a client connects to the AP the phone must give the client a dhcp ip address. Gateway / DNS is irrelevant, as it wont be used. The client then upon connection initiate a ftp call to the phone with the AP on. Pulls the file, and disconnects. And that's it.
 

emexes

Well-Known Member
Licensed User
I don't know if this applies to all phones or Android versions, but on my Alcatel 1C here running its original Android 7.0 ie no hacking or rooting done:

the hotspot can be used, without being connected to the internet by wifi or any other connection, with or without a connection to a mobile network, and with or without a SIM installed (just checked).

I'm pretty sure most other phones do this too, because it is something I often use when I am doing B4A programming out in the field without access to a Wi-Fi network for B4A-Bridge. I've just done it again here to make sure I've got my facts straight, and it works great. A small trap is that the served network is 192.168.43.* rather than the more usual 192.168.0.* or 192.168.1.*, and the only anomaly I've found is that B4A-Bridge says "My IP: Not connected to wireless network" when clearly it is because I've (i) uploaded and run a B4A program through it, and (ii) downloaded this screenshot using the B4A-Bridge File Explorer:

upload_2019-7-1_9-49-50.png


(in fact, I just had a couple of minutes of confusion here trying to add that screenshot to this post, because I forgot that I'd switched off the regular internet Wi-Fi when doing these tests...)

Perhaps the B4A-Bridge FTP Server could even be your FTP server, or at least help during development. I have a vague recollection that the source code is available.

Turning on airplane mode does seem to solidly disable the "Portable Wi-Fi hotspot" option, though (cf Wi-Fi and Bluetooth, which are switched off when entering airplane mode, but you can then go back in and turn them on whilst still nominally in airplane mode).

Curiously, the "Bluetooth tethering" option is still available. I'll leave that trail for you to explore if you want to.

:)
 

Attachments

Jaco vd Walt

Member
Licensed User
Thank you so much for taking the time to reply. What a awesome community i

Im good with the ftp part, thats all working great.

I feel silly that I assumed ithe hotspot won't work ! I will try it out and update . Thanks again !
 
Top