title: how to scan for wireless network and connecting programmatically in android?
body: <p>I'm trying to build this app which scans and connects to wireless networks. I used a sample code from the following link</p>
  
  <p><a href="http://www.androidsnippets.com/scan-for-wireless-networks" rel="nofollow">http://www.androidsnippets.com/scan-for-wireless-networks</a></p>
  
  <p>But the list it returns seem to contain duplicates. Also can someone give me an example as to how to connect to a particular network programatically please?</p>
  
  <p>Thank you</p>