Skip to main content

How to connect an android phone to your ad-hoc wi-fi network

Cannot see ad-hoc wifi "Wireless" on android phone, do not worry.
EDIT: You can connect android phone without rooting your device using a program called Connectify that turns you PC or laptop into an access point that phones can see, but this program only works on Windows 7 not XP not Vista.
Read more about connecting your Android phone to a laptop or pc using Connectify.

I got my HTC Hero with android today and I am aboard, when I tried to connect it to the internet using an AD-HOC wireless network it didn't see it, but a program called Wifi analyzer can see the adhoc network "A Program I installed from android market", if you don't have windows 7 the only solution so far is rooting your device then:



First: I have yet to be able to connect to the ad-hoc network with WPA1&2-security. But I am pretty sure it should work, we just need to work out the correct configurations in the system files. Right now I am connected with WEP-security. That will keep the neighborhood noobs of my wifi-network, but it is not a satisfactory solution for security in the long run, as it _easily_ can be cracked by neighborhood parasites with freely available tools. In time, one should therefore really try to configure the connection with WPA2.
Here is the approach I used to allow connections to ad-hoc wifi networks with HTC Hero:
We need to edit two system files within Android; /system/etc/wifi/tiwlan.ini and /data/misc/wifi/wpa_supplicant.conf. I prefer doing this with Android’s debugging bridge (adb), to avoid messing with badly written terminal applications for the HTC Hero. Adb makes it possible to alter android system files from your command line on your computer. To use adb you need to install the drivers. Most Windows-users have these installed from when installing HTC Sync. I use Linux and had to install them by grabbing the Android SDK from their homepage (I can elaborate on this if necessary). Note that you will have to ‘root’ your device to make the procedure work (if necessary I can elaborate on this, as well. It basically means that you achieve full system read/write capabilites on your device). You might also need set the device to ‘USB debugging’-mode. You’ll find out soon enough :)
Open a terminal window (in Windows, the command line) and type:
Code:
adb pull /system/etc/wifi/tiwlan.ini .
This will copy the file from the device to the computer. In Linux the file will be stored in the user’s home directory. I am not sure where it will be stored in Windows (search for it if you can’t find it). Open the file in a text editor. Locate the text “WiFiAdhoc = 0″ and change the 0 to 1. Then we will place two new lines right underneath it, to make it look like this:
Code:
WiFiAdhoc = 1
dot11DesiredSSID = InsertyourSSIDhere
dot11DesiredBSSType = 0
Replace InsertyourSSIDhere with the name/SSID of your planned ad-hoc network. We are finished with this file for now, so save and close the file.
In the terminal, type:
Code:
adb pull /data/misc/wifi/wpa_supplicant.conf .
Wpa_supplicant.conf is the tool we use to configure the network security. Open the file in the text editor. I have my file configured like this:
Code:
ctrl_interface=tiwlan0
update_config=1

eapol_version=2
ap_scan=2
fast_reauth=1

network={
    ssid="InsertyourSSIDhere"
    scan_ssid=0
    mode=1
    key_mgmt=NONE
    group=WEP104
    auth_alg=SHARED
    wep_key0="InsertyourownPASSKEYhere"
}
Once you are happy with your configuration, save and close the file.
Ok, now that we have configured the files, we will transfer them back to the HTC Hero by executing the following commands (each line is a new command):
Code:
adb shell
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
exit
adb push tiwlan.ini /system/etc/wifi/tiwlan.ini
adb push wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf
adb shell
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
exit
Now you just have to create an ad-hoc wi-fi network with internet sharing on your laptop. There are numerous online guides on how to do this. The important thing is to match the network settings with the configuration in wpa_supplicant.conf. Note that ‘WEP104′ might be labelled  ‘WEP128′ in the network manager on your computer. Once you have created and activated your new ad-hoc wi-fi network, configured with internet sharing, turn on the wi-fi on your HTC Hero. You will see the ad-hoc network listed immediately, but wait a minute or two for the device to obtain the network address distributed from the laptop.
That’s pretty much it! You should now be online on your HTC Hero through your ad-hoc wi-fi network. The device should automatically be connecting to the network when wi-fi is enabled at both laptop and device.
Keep in mind: please consider this a temporary solution; we should really strive to configure wpa_supplicant.conf with WPA2-security. I’ll be back with another blog post if/when this is achieved.
Disclaimer: Remember, I am not responsible for your actions :)
VIA [TIS]

But I wont try it any soon, I wont give up HTC hero original ROM just for ad-hoc networks, I will wait until I get a reasonable reason to root my device.
My recommendation "Buy an access point" for me I will wait until I am back from my vacation for now I will use a near public wifi.

Comments

mrbrocks said…
great article :)
diyism said…
Connectify only works on Windows 7 not XP not Vista,
but VirtualAccessPoint v2.2 works on windows xp.
Anonymous said…
Yes but lots of wi-fi cards do not supported the ap mode, only the ad-hoc.
webvan said…
Thanks, but not working on Motorola Milestone.
littlebearz said…
I m using enterprise windows 7,but adhoc does not work. Maybe I m doing it wrong
S3nd41 said…
Tested Connectify on Windows 7 64-bit and it works like a charm with my Android cell.
Anonymous said…
Or you can try this one ... http://www.youtube.com/watch?v=rDfR5yuu5R4 it doesn't solve the problem to connect to any, but you can have the internet connection and more..
Anonymous said…
Any comment on getting this to work with the Droid Incredible?
Anonymous said…
Ad hoc network still not showing on Evo

Popular posts from this blog

Free Online Anti-Mosquito, Pest, Rats and Bugs Ultrasonic Generator

No need to download any files or apps, just open this page on any device no matter PC, Mac, Android, iOS, Palm OS, anything really can run this page, so make sure to bookmark it!

Ultrasonic Generator Features
Anti Mosquito.Anti Bugs like Cockroaches.Anti Other kinds of Pest.Anti Rats and other small animals.Anti Teens, yes it annoyed them too much they will leave you alone. Usage:Just open this page, scroll down and click start on any handheld, PC, MAC and others.Turn on the volume of your device up to max.Do not use headphones.You might not hear the sound if you are older than usually 20, if you have a good hearing than you will.
Click start below to get the ultrasonic started.

STARTSTOP

Portable Wi-Fi Routers: A Smarter Way to Stay Connected While Traveling Across Spain

Spain has certainly emerged as one of the top tourist destinations around the world. Millions around the world plan holiday trips and vacations across various cities and counties in Spain. However, the biggest challenge while traveling abroad is staying connected. Most tourist
s find it hard to stay connected with their family members, relatives and friends back in the home country because they are not really sure about which networks they should buy and what kind of service they should choose.

At times many people feel that they are being cheated because of the high charges that they have to incur.
While there are hotels in Spain that offer better Wi-Fi connectivity for tourists the problem is that they charge high rates for it. This means that you end up spending more on the connectivity than on any other services. Many tourists feel that it cuts down their budget and that is not something that they prefer. Travelers today want to stay connected with their loved ones even while the…