For what it's worth, I've seen a lot of the same behavior people have described here. I've managed to tune away most of the hiccups that were the primary cause of dropped connections for me.
First, turn off Bluetooth. It operates in the same 2.4 GHz ISM band as Wifi and (may) cause significant interference. I find that I can almost never establish a Wifi connection if Bluetooth is on. When I can establish a connection, it drops frequently. This causes me a slight bit of heartburn that I can't use Wifi and Bluetooth simultaneously, but I can live with it for a better Wifi connection.
Second, check out and adjust the settings on your router. Unless you are an electrical engineer or a wireless networking expert, you are probably going to have to use trial and error. I found that the only parameters that seemed to make any difference on my setup were flavor of 802.11 (b,g,n,etc) was in use and what channel the router broadcasted on. Changing between b/g/n obviously has implications on range and throughput, so keep that in mind. My setup seems to work best with 802.11b which sucks but at least it works more reliably. Choosing a channel is a matter of finding out what channels are in use by other access points within range. I suggest the Wifi Analyzer app on the marketplace. It is one of the best tools on android as it turns your phone into a pretty good Wifi analyzer. It will show you what access points are around you and what channels they are using in graph form, so you can clearly see where you overlap. I changed my router from Auto Select (this helped reliability a bit too) to a specific channel away from what other people were using.
I still have other issues with Wifi, but these changes made the most difference in reducing dropped connections. It is still sometimes difficult to establish an initial connection, especially when I turn Wifi on via the home screen widget. Doing it through the options menu works a bit better. The symptom is that the phone will turn on and off Wifi over and over until it eventually scans for access points and finds mine. There are also times where I have a good connection to my router but all traffic that leaves my network seems to go nowhere. I've found this is mostly due to my crappy internet connection and not the phone.
First, turn off Bluetooth. It operates in the same 2.4 GHz ISM band as Wifi and (may) cause significant interference. I find that I can almost never establish a Wifi connection if Bluetooth is on. When I can establish a connection, it drops frequently. This causes me a slight bit of heartburn that I can't use Wifi and Bluetooth simultaneously, but I can live with it for a better Wifi connection.
Second, check out and adjust the settings on your router. Unless you are an electrical engineer or a wireless networking expert, you are probably going to have to use trial and error. I found that the only parameters that seemed to make any difference on my setup were flavor of 802.11 (b,g,n,etc) was in use and what channel the router broadcasted on. Changing between b/g/n obviously has implications on range and throughput, so keep that in mind. My setup seems to work best with 802.11b which sucks but at least it works more reliably. Choosing a channel is a matter of finding out what channels are in use by other access points within range. I suggest the Wifi Analyzer app on the marketplace. It is one of the best tools on android as it turns your phone into a pretty good Wifi analyzer. It will show you what access points are around you and what channels they are using in graph form, so you can clearly see where you overlap. I changed my router from Auto Select (this helped reliability a bit too) to a specific channel away from what other people were using.
I still have other issues with Wifi, but these changes made the most difference in reducing dropped connections. It is still sometimes difficult to establish an initial connection, especially when I turn Wifi on via the home screen widget. Doing it through the options menu works a bit better. The symptom is that the phone will turn on and off Wifi over and over until it eventually scans for access points and finds mine. There are also times where I have a good connection to my router but all traffic that leaves my network seems to go nowhere. I've found this is mostly due to my crappy internet connection and not the phone.