A huge requirement I had sometime back is allowing my Android device to access Internet by using the connectivity of my laptop. I use a HSPA dongle connected to my Ubuntu 12.04 LTS system via USB port for connecting to the Internet. Additionally, my Android device has Internet connectivity through the mobile network however is has a limited data capacity compared to my laptops' Internet connection. So, what I really wanted do is, spare my mobile data connection in the Android device and use Internet via my laptop as much as possible specially when I need to do some heavy work such as installing some big app or updating the Android system and apps.
The solution is making a Wi-Fi access point in my laptop so that my Android device can connect to the Wi-Fi network to access Internet. After searching in the web and trying different ways, I found two methods to do it. Even through the both methods are supposed to work properly, only one worked for me. I will describe the worked method for me and also at the end I will mentioned the other method which didn't work.
Method - 1
First, you should download the shell script given in this link. Save it to somewhere in your system such as Downloads directory. We should run the shell script from the terminal as follows and also the other commands to start and stop the access point when needed.
sudo sh install_wifi_access_point.sh
sudo service wifi_access_point start
sudo service wifi_access_point stop
Each time I start the service, the network manager of Ubuntu gets restarted and therefore I had to reconnect to the Internet connection of my laptop using the HSPA dongle. Anyway, its not a big issue.
Method - 2
This is the method which didn't work for me. However, hoping that somebody will get benefited from it, I'm sharing that information too. In this method, we need to install a package called ap-hotspot. Do it using the terminal as follows.
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install ap-hotspot
We can configure the ap-hotspot tool for the first time using the following first command. After that, we can use the other two commands to start and stop the Wi-fi hotspot.
sudo ap-hotspot configure
sudo ap-hotspot start
sudo ap-hotspot stop
Hope this information will be useful for somebody in the future including me too because definitely I will forget how I did it after a while. :)