This can be done by setting up your windows machine as a very simple wireless access point, similar to the ad-hoc functionality, more difficult to set up but far more robust, i.e. any device that supports WiFi will be able to connect. It is known as 'hostednetwork' and uses the built-in Microsoft Virtual WiFi Adapter.
To set it up, bring up the elevated command prompt by pressing Win-key
, typing cmd
and hitting Ctrl-Shift-Enter
. Then enter the following command:
netsh wlan set hostednetwork mode=allow "ssid=<ssid>" “key=<passphrase>” keyUsage=persistent
Most options are quite self-explanatory, but you can get more info using netsh wlan help
. After executing this command, the hostednetwork will be stored permanently, but still needs to be started and stopped manually. You might want to create some sort of shortcut for the following commands:
netsh wlan start hostednetwork
netsh wlan stop hostednetwork
Note that these commands too must be run as admin.
At this point, a new item should have appeared in the 'network connections' section of the Windows network center. You can edit its properties, but the default settings should work just fine. Your phone should be able to detect the freshly made access point and connect to it, obtaining an IP-address in the 192.168.137.0/24 range. Don't worry though, this will not affect the wired connection on your computer, as they're both using different networks.
While a connection has been established, your pc will not allow machines on the wireless port to interface with any other ports and by extension, the internet. For this, you can use Internet Connection Sharing (ICS). Edit the properties of your wired interface, bring up the 'Sharing' tab, check the box to enable this feature and select the corresponding interface, the wireless AP that is. The interface is a bit buggy, you might need to revert, close the window and try again if you go wrong.
Voila, internet on your Android via your pc.
You don't have to have a second Wi-Fi card to be able to share an Internet connection, most modern Wi-Fi chips are able to run in both client and access point modes simultaneously, see this article. The needed commands to set up and enable the Wireless Hosted Network are:
netsh wlan set hostednetwork mode=allow ssid=YourNetworkName key=YourPassword
netsh wlan start hostednetwork
This is a solution for Windows 7 and above. For Windows XP there is Virtual Wi-Fi from Microsoft Research, although it's a bit limited in that you can't use it with WPA-encrypted connections, only WEP is supported.
Best Answer
First things first, enable bluetooth on your phone, pair it with OSX.
Now on the phone (this is on Android Lollipop), go to
Settings -> Wireless & networks -> More -> Tethering & portable hotspot -> enable Bluetooth tethering
.On OSX, create a new Bluetooth PAN, you will be presented with the device you paired earlier
Then whatever means the phone is using to connect to the internet, in this case WiFi, will be shared to your Laptop.