Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

Is it possible to actually, legitimately, or even programmatically, configure the Android wifi manager to connect to an access point and use a static IP address, where no dhcp service exists? I'm aware how to specify a static IP in the wifi manager's advanced settings, but each time I attempt to connect to my open, unprotected, test access point it goes through the typical..."Connecting"..."Obtaining IP..." Then eventually it disables the access point and I have to forget it, then try again.

I've tried writing a test app to programmatically configure my WifiConfiguration, but it never works. I either get class reflection errors, or literately, nothing happens. I'm not mentioning this because I want to solve the programmatic approach, I simply want to connect to a wifi network using a static IP.

I also tried playing with iwconfig and ifconfig. The idea was to try and bring eth0 up, configure it statically, then use iwconfig to connect to my ESSID. I'll start by enabling wifi from the device's settings. Using ifconfig eth0 will report "eth0: Cannot assign requested address". (possibly because of my existing static IP settings?) iwconfig will display eth0 though:

./iwconfig lo no wireless extensions.

usb0 no wireless extensions.

sit0 no wireless extensions.

ip6tnl0 no wireless extensions.

eth0 IEEE 802.11-DS ESSID:"" Nickname:"" Mode:Managed Frequency:2.412 GHz Access Point: Not-Associated Bit Rate:72 Mb/s Tx-Power:32 dBm Retry min limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Managementmode:All packets received Link Quality=5/5 Signal level=0 dBm Noise level=-92 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Setting iwconfig eth0 essid and iwconfig eth0 channel 1 (the channel my AP is running on), then iwconfig eth0 commit, won't do anything. My iwconfig config doesn't change. e.g. the ESSID is still ""...

Is this even possible? I don't care how. Thanks in advance!

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.