Make my Android app connect to a Raspberry Pi 4 wifi using known ssid and password

Viewed 211

I would like my android application to automatically connect to my Raspberry Pi 4 stand alone access point, knowing the ssid and password. However, from what I can find its not secure and hard to force connection to a wifi without direct user consent.

Can this be accomplished? Or is there a better way, like making Wifi Direct between the phone and Raspberry device?

If so, can you guide me in the right direction?

The stand alone access point is created as so:

ssid="RPiNet"
mode=2
frequency=2437
#key_mgmt=NONE   # uncomment this for an open hotspot
# delete next 3 lines if key_mgmt=NONE
key_mgmt=WPA-PSK
proto=RSN WPA
psk="password"
1 Answers

Not sure what you mean by wanting your app to connect to the Access Point, but if something that you can establish an SSH server or something similar on. You might have some luck with the free 3rd party library JSCh (Java Secure Channel). If you're looking to tune in on specific frequencies / bands, that may require a bit more in the way of low-level radio control..

To my knowledge on that end there's probably something in the android libraries that allows you to access wifi parameters; however, you may need to provide administrative permissions and most devices typically only connect to one 802.11 device at a time, so you'd have to make sure your existing connection isn't fighting to take over.

Related