Well, hacking is not very nice, as it is a crime in fact. Instead of having all the hassle to do that you can look for apps that allow you to connect to public and private wi-fi networks. In fact it kind of does that hard work for you, I am not sure if it hacks the networks, though I believe they do. There are some apps that allow you to find these wi-fi connections wherever you go. To name a few you can try Wi-fi Map, Vazoo, Mandic Magic. There are many more, I am sure.