Sunday, 3 June 2012

AndroidWifi

To read the update messages on this guide click here
 
A few months back, I bought an android phone. I found android was way better than iOS, except for one little issue, which I was fortunate enough to get around. I have always been sharing my internet connection with my phone, be it an iPhone, iPad or any other device. They all worked pretty well with my windows Ad-hoc connection sharing. Except for this phone which is really a major disadvantage.

A lot of people use connectify to get around this on windows 7. For me, as it has always been, I wanted something simple and fast. I did some search, and found out an easy way of making a virtual router. This involved using command line to give commands for enabling virtual wifi, so it was easy for me to write a batch script which did all the work for me. Its pretty much same as connectify, but way faster and simpler, plus instead of using that 'advertising' SSID in connectify, you can choose your own SSID name with this method. I have divided the setup into few simple steps, so everyone can understand easily.

Settings on your phone

While I was trying to make a virtual router on my laptop I could connect successfully but after a while the phone had problem browsing, connecting or even discovering the virtual router. I started troubleshooting, and found out that the problem was not with the virtual router, but it was in the phone settings. My android phone used network based location services which, whenever the phone connected, tried finding the location using the network. It was this service which made the wifi connection impossible. I disabled this and it started working as a charm. To disable this service on Nexus S (Ice Cream Sandwich), go to Settings->Location Services and disable all services as shown below.


Disabling these options will be similar in other android phones as well. Just look for Location options in settings, and you will get there.

Settings on your pc
 
UPDATE (21/07/2012): I have written an application for doing this step. 
Here is the link: AndroidWifi is live!
If you use this application then this step can be skipped. 

I have written this guide using Windows 7, however similar method can be used on Windows Vista. To start with settings on your pc, first thing you have to do is make a batch file. To do this open a new notepad window and copy the following lines.
netsh wlan set hostednetwork mode=allow ssid=MySsid key=MyPassword keyUsage=persistent 
netsh wlan start hostednetwork
Replace MySsid with the SSID name you want, and MyPassword with your own password. Save this file as TurnWirelessOn.bat, and make sure the extension is .bat.

As you might have already guessed this batch file will be used to turn on the wireless connection. We need one more batch file to turn off the virtual router. To do this follow the same procedure as above replacing the commands with the following commands.
netsh wlan stop hostednetwork
 Name this file as TurnWirelessOff.bat for simplicity.












Sharing your connection
Now comes the tricky part. You have to run the above batch file, which will first create a virtual wireless connection. After it has been created, you can use it to share your LAN connection to. To do this, right click  on TurnWirelessOn.bat file and select run as administrator.



 This will enable an internet connection with the SSID and password you provided. Now go to Network and Sharing Center->Change Adapter Settings. You will notice two wireless connections, as shown below:






Note down the name of the wireless connection which uses Microsoft Virtual Wifi Miniport. In this case it is called Wireless Network Connection 2.

Now right click and open properties of Local Area Connection. Go to Sharing and enable  connection sharing and choose Wireless Network Connection 2.




Once you apply the settings, you might get a notification that the connection is currently active. This can be fixed by TurnWirelessOff.bat. Opening this file as administrator will turn the connection off, enabling you to set the sharing options.

Once everything is set up, just use the two batch scripts to share your internet connection to your android, and enjoy!

Update (07/07/2012):  As I can not try this method on different version of windows, with different models and android version, therefore I request everyone to please leave a comment with windows version, mobile model, type of internet shared and android version

If it is working great for you, why not share it with others. It will just cost you a simple LIKE at alternativeto page for this software (I don't really think it is, but lets just call it a software)

Cheers!
 
This work is produced under the following creative commons license: 
 
Creative Commons Licence
AndroidWifi by Muhammad Asad is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Based on a work at http://seevisionc.blogspot.co.uk/2012/06/androidwifi-alternative-to-connectify.html.

_______________________________________________________________________________________
Update(13/08/2013): I am seeing a lot of bloggers copying this blogpost as it is on their blogs without mentioning the source where they copied it from. For this reason I have created a creative commons license for this, which means that you can copy, modify and use the content as long as you share your software free of charge and mention the source.
_______________________________________________________________________________________

Update (11/03/2013): I have been really really busy with work, and therefore have limited time to answer everyone's questions. If you get stuck somewhere, then please read all comments as solution to almost every problem you can come across can be found in the comments. If you succeed please post the following details in comments below, as these might help anyone trying to share internet with similar setup as yours:

1. Windows Version
2. Mobile Model
3. Type of Internet Shared 
4. Android Version.

If you find out any additional detail that is missing, or anything which solved the problem you are having and is not listed below, PLEASE DO WRITE IN COMMENTS BELOW. THANK YOU!!

_______________________________________________________________________________________
Update (21/04/2013): I am seeing a number of interesting links coming in to this post. I thought it might be interesting for you people to find out about what other devices/areas this script is able to work.

1. This guide has been used by a user of roku streaming player to share his existing internet connection with the roku player. The original forum post can be found here, and might be able to solve a very common issue of not being able to access internet, despite being connected to the virtual router.

2. A question from a reddit user, which can be found here.

3. Other bloggers, translating and writing the same guide again with some modifications, so people can understand in their native language. This post can be accessed here

4. A senior forum member at xda developers forums recommended this method to other users. The full thread including the post can be found here

5. Users have recommended this method on pcmweb.nl forums. This post in Dutch. Thanks to google translate, the users are recommending this method over buying a wireless repeater hardware.

Click here to go to back to the start of this post
_______________________________________________________________________________________

143 comments:

  1. i'm trying connect via usb modem. SUCCESSFULLY CONNECTED BUT COULDN'T ACCESSING INTERNET :( DAMN..

    nexus s ics..

    ReplyDelete
    Replies
    1. You have to check two things:
      1. check if the internet is shared successfully with the SSID. This can be seen in network and sharing center where it will show that internet access is available for the specified SSID. If this is the problem, then repeat the internet sharing process, making sure you follow everything exactly as mentioned here.

      2. If the internet access is available, then it is the location services of your android. Try turning GPS and Network based location services off Sometimes rebooting your device can help kill any related services after disabling them.

      I hope this helps. I am my self using Nexus S ICS.

      Delete
    2. thanks bhaijaan, actually i am using xperia arc s, i have a usb broadband connection in my laptop, i shared it on wifi through connectify as well as by your method, & also successed to connect to internet but after 20/30 seconds my phone shows authentication error, so i have to again restart wifi in my phone it again connects & also disconnect in same manner. pls tell how to solve this problem.. fogatnitin@gmail.com

      Delete
    3. I have the same problem. Its a real horror. It doesn't work and I don't know what to do anymore

      Delete
  2. I am not getting virtual wifi minipoint after running the Turnwirelesson.bat file???
    Can i do it if i am using a tata photon + dongle.

    ReplyDelete
    Replies
    1. To enable the virtual wifi miniport try the following:

      go to start-> type cmd
      when you see cmd.exe right click and run it as administrator

      Then in the command prompt type the following commands:

      netsh wlan stop hostednetwork

      netsh wlan set hostednetwork mode=disallow

      netsh wlan set hostednetwork mode=allow

      It is very important that you enter all of the above commands, one by one.

      Please let me know if this works for you, so that I can update it in the guide.

      About tata photon + dongle, I have no idea. Wifi miniport is a feature within windows 7. It works with most wifi adapters, but there are still some exceptions.

      Delete
  3. This solution is not working for a friend of mine who wants to share his 3G World Call USB internet connection through his WiFi, any thoughts ?

    ReplyDelete
  4. I can create an hotspot, but cannot obtain IP on my cellphone.
    Please help. Thanks!

    ReplyDelete
    Replies
    1. can you please tell me which device are you using?

      Not able to obtain an IP can occur due to several reasons,

      1. Check if the internet is shared with the virtual wifi having correct format of key. I use an 8 character key which also contains numbers in it. My advice try using different key, for me the key: mykey123 is working perfectly fine.

      2. Another problem which could occur is dependent on your phone. In my case the phone had the google's location services option turned on. This prevented it from getting an IP. If you can find this option disable it, and then try reconnecting to the network.

      3. If you are still not able to obtain an IP, then try using a static IP. You can get the ip of the connection associated with virtual router, change the last byte and assign it. For example, if the ip for the router is 192.168.20.1 then just replace 1 with any other value between 2 to 255. In this case I would assign a value like 192.168.20.2 as a static IP for my phone.

      Please let me know if this helped.

      Delete
    2. I'm using a Galaxy Nexus and by creating a static IP address I was able to connect.

      Delete
  5. Thanks it worked on samsung Galaxy ace 5830.

    ReplyDelete
  6. thanks buddy. . . . . i am able to use my usb dongle(tata photon/ bsnl evdo)with a little change instead of this step "Now right click and open properties of Local Area Connection. Go to Sharing and enable connection sharing and choose Wireless Network Connection 2."
    right click on the usb device as in my case and open properties and enable connection sharing and choose Wireless Network Connection 2.
    once again thanks for sharing

    ReplyDelete
    Replies
    1. Thank you for updating with this information, I am sure this will help someone who is trying to use a similar device

      Delete
  7. Does this really work for Vista?
    As mentioned here: http://alternativeto.net/software/androidwifi/about

    ReplyDelete
    Replies
    1. Dont think so.
      Did "netsh wlan set ?" and hostednetwork is not one of the options.
      This is new for Win 7, or am I missing something here?

      Delete
    2. I have not tested the method with Vista, but it should work fine.
      I also found the virtual wifi installation package for windows xp, this might not help you, but it also makes this method compatible with windows xp

      Here is the link:
      http://research.microsoft.com/en-us/downloads/994abd5f-53d1-4dba-a9d8-8ba1dcccead7/

      Delete
    3. I have install the Microsoft Virtual Wifi package on my Window XP and try to create a hotspot using your method but somehow I can't create the Virtual Wifi Miniport. Check status and I get this "The following command was not found: wlan stop hostednetwork" Did I miss a thing?

      Delete
    4. Do tell how to do it in vista?

      Delete
  8. Thanks for this impressively simple solution! Love it. Works great on my Galaxy Nexus

    ReplyDelete
  9. thank you so much, it's working with my 3G modem and Alcatel 918n :3

    ReplyDelete
  10. I have tried to solve this problem for 4 days with no succsess..
    I have a 3G usb modem and I want to share internet to my android phone running on 4.0 ICS.
    The thing is that I have vista, will it work?

    ReplyDelete
    Replies
    1. hey allan1, I have not tried it. Just try it and let me know the results, should work fine in vista as well. If you see earlier comments, people have had success with USB modems, although with minor changes for connection sharing part.

      Delete
    2. Im not getting second wireless connection....

      Delete
    3. naah forget it..bought new wireless wifi modem instead and works like a charm.

      Delete
  11. I just upgrading my sgs2 to ICS 2 days ago and now I'm really frustating. I've tried all these steps above, but the result is still the same. My phone connected, but couldn't access internet. Yesterday, my phone connected perfectly with my campus wi-fi, but not with my laptop. I'm installing both virtual router and connectify. My laptop running win 7 and sharing internet via LAN...

    ReplyDelete
    Replies
    1. This method is an alternative to connectify, it cannot work if connectify is running. Its hard to say exactly what's wrong, but it looks like your phone has trouble using dynamic ip on virtual wifi router. Have you tried using a static ip?

      Delete
    2. Yes, i've tried it. I already turned off connectify when turned on virtual router, but nothing changed. Now I think I should try to reset my phone to factory default settings :(

      Delete
    3. Hi again, I've reset my phone to factory default last week, then tried to connect to my laptop wi-fi, but nothing happened. But now, it works like magic... Dunno why this happen...

      Delete
    4. Its good to hear that it is working for you. Please let us know, if you find out, about what fixed the error in your case.

      It might help anyone else encountering the same problem.

      Delete
    5. Hi, I think this thing should worth to try. Few days ago, after went to a restaurant with my friend, I couldn't connect my phone to my laptop's wi-fi, although I could connect to the restaurant wi-fi which was supposed to be a wi-fi router modem. Then I remember my friend told me that her iPod touch won't work suddenly when she played a game. The game closed itself when she was tried to open it. Then she tried to install a free apps, and all games and apps working again. So I gave the same treat to my S2, but I didn't tried to connect it to my laptop after that. I just tried it an hour ago, and it just working again :)

      Delete
  12. As mentioned at:
    http://www.virtualwifirouter.com/2012/03/trick-to-fix-obtaining-ip-address-issue.html

    The problem where the phone keeps on disconnecting at obtaining ip can be solved by disconnecting the mobile from network. In wifi settings of the phone go to advanced wifi settings and check "Use Static Ip" checkbox. After this connect to wifi with password. Now while it is trying to connect, again go to advanced settings and uncheck "Use static Ip". I dont know how it works, or whether it would work for any phone or not, but when nothing is working, its worth giving a try.

    ReplyDelete
  13. Well,
    I have tries this method on my desktop by using WLAN. But my phone looses it's connectivity repeatedly. Hot to fix...

    It's SonyEricsson Xperia8, I tried in public network with this phone, it works without any trouble.

    ReplyDelete
  14. Hi, I tried this and my phone can connect but no Internet access.

    However, it can connect to my local WAMP server, which mean Internet is not actually shared although Windows says it is... don;t know what to do next.

    ReplyDelete
    Replies
    1. Share ur Lan network first...with http and https

      Delete
  15. Hi, I tried with the .bat files but could not get the Mini Wifi port. Then ran the .bat file from the command prompt (with Admin privileges) and got the below mesasage.
    ---------------------------------------
    D:\>netsh wlan set hostednetwork mode=allow ssid=testwifi key=xxxxxxxx ke
    y Usage=persistent
    The hosted network mode has been set to allow.
    The SSID of the hosted network has been successfully changed.
    The user key passphrase of the hosted network has been successfully changed.

    D:\>netsh wlan start hostednetwork
    The hosted network couldn't be started.
    The group or resource is not in the correct state to perform the requested operation.
    -----------------------------------

    Help me get over this issue. Thanks

    ReplyDelete
    Replies
    1. Try restarting your PC/Laptop, then use these commands.
      This error occurs when you take your laptop out of sleep mode

      Delete
  16. I also keep getting the "The group or resource is not in the correct state to perform the requested operation." error as well. It worked for me the first time I tried it, but now I'm stuck.

    BTW, this command is handy:
    netsh wlan show hostednetwork

    I would put it at the end of the on bat file. Also, anyone know how to change the channel?

    ReplyDelete
  17. I'll add a bit more detail regarding the incorrect state error.

    If I press F12 on my laptop to disable the built in Wifi so I can connect via a usb Wifi adapter, I'll get this error message if I don't turn it back on before running the batch file. However, if I put the laptop to sleep, and wake it up again the MS Virtual Miniport Adapter shows up as stopped in the device manager due to a cryptic error 10. Then making sure the wifi adapter is switched on does not help.

    I'm using Windows 7 Home Premium 64 bit with an Intel WiFi Link 1000 BGN adapter in an HP DV7-TQE using Intel driver version 14.x which Microsoft's update claims is the latest. Going to Intel's site, I'm trying driver 15.1.1 released 5/3/2012 to see if that will solve the sleep problem.

    On the first test, this seems to help a great deal. I need to restart the hosted network after sleep, but at least it works without a reboot! After several tries, I've lost the DHCP server on the hosted network. My devices connect, but don't get an IP address.

    Intel has a utility called "Intel® My WiFi Dashboard Software for Windows 7*" which seems to have a GUI that might make this process much easier.
    I tried to install it, but only ended up with a lite version that does not support the hotspot feature. So much for that idea. It looks like I'll be reinstalling conectify.

    ReplyDelete
    Replies
    1. For some reason, when I try to share after I wake my laptop from sleep, it shows the same error. This is regardless of what software I use to share, as connectify is just giving a user interface while at the backend its still using the same commands.

      To fix this error, I have found out that if you restart your laptop, it works fine. But as soon as your laptop goes into sleep mode, the same thing happens. I hope this would help you

      Delete
  18. I've combined everything into one batch file with enough reminders that I can usually get things working after a reboot. After the wireless driver update, I can sometimes restart the hostednetwork after sleep or hibernation.

    Here's the code:

    netsh wlan set hostednetwork mode=allow ssid=Virtual_Hotspot key=EnterYourKey keyUsage=persistent
    echo Please verify your Network Connection is on and the sharing property allows ICS and has the correct Microsoft Virtual WiFi Miniport Adater set as the "Home networking connection".
    netsh wlan start hostednetwork
    netsh wlan show hostednetwork

    Pause Please verify your Wifi is switched on

    echo Right click on your Internet connection in Network Connections, select Properties, then the Sharing tab. Make sure the allow box is check, and Virtual_Hotspot is the "Home networking connection"
    echo Note, if you switch to Details view, the connectivity column should show "Internet access" for both connections. If not, uncheck ICS and set it up again via Properties...
    ncpa.cpl
    pause Please verify your network connection sharing property allows ICS and has the correct Microsoft Virtual WiFi Miniport Adater set as the "Home networking connection".
    netsh wlan start hostednetwork
    netsh wlan show hostednetwork
    pause Press the Enter key to verify your device has connected after selecting the Virtual_Hotspot AP
    netsh wlan show hostednetwork
    pause Press the Enter key to check your connected device list again.
    netsh wlan show hostednetwork
    pause Press Enter again to STOP your HOTSPOT
    netsh wlan stop hostednetwork

    ReplyDelete
    Replies
    1. I haven't had to reboot now for about four days. Disabling and then re-enabling my wifi adapters, or using the network troubleshooter to reset the adapters seems to be doing the trick. I have put my computer to sleep several times, but when I get back to where I need to share my usb Internet connection, I've been able to do so with the above script. I think it helps to always stop the hostednetwork before going to sleep or hibernate.

      Delete
    2. that is great MarkZ. Have you tried using the application I wrote on top of this script? do check it out at:
      http://seevisionc.blogspot.co.uk/2012/07/androidwifi-09-is-live.html

      Delete
  19. My Galaxy Young Can see the network but it can't connect
    i try to use static IP but it failed

    ReplyDelete
  20. Hello. I am very excited to get this working!!! Thank you for all your effort. I am however stuck at the Local Area Connection properties. I check the box, allowing other networks to connect, the click "OK" I get a popup saying,

    "An error occurred while Internet Connection Sharing was being enabled. The specified service does not exist as an installed service"

    I have exactly followed the instructions previous to this error so I am not sure what I am doing wrong. Could you please help me? If you could email me m(dot) chua79 (at)yahoo.com

    Thank you for your time.

    -Mike

    ReplyDelete
    Replies
    1. can you please tell me which operating system you are using?

      Delete
    2. have a look at this solution i found by quick googling:

      http://www.geekstogo.com/forum/index.php?act=ST&f=5&t=51545

      Delete
  21. Hi. Everything seems to work out well, the Wifi connects, but when i try browsing the internet, it does not open any page. I changed the static IP address to the address in my LAN, same thing! (For eg, i have 192.168.1.100, i changed it to 192.168.1.2)

    What's missing? My laptop says "Internet" below SSID of my connection so the connection is working... but no idea whats wrong!

    ReplyDelete
    Replies
    1. Added info: Using Android 2.3.5, HTC Explorer.

      My Internet is accessed through Dial-Up LAN, used in BSNL Internets...

      Delete
    2. use the standalone application at: http://seevisionc.blogspot.co.uk/2012/07/androidwifi-09-is-live.html

      and copy the output of log.txt in comments

      You should use ip of the network which you are connecting to using Wifi, and not the connection which is shared

      Delete
  22. here is the log:

    Output
    ==============
    The hosted network mode has been set to allow.
    The SSID of the hosted network has been successfully changed.
    The user key passphrase of the hosted network has been successfully changed.

    The hosted network started.

    Yes i am using my Modem's IP address

    ReplyDelete
    Replies
    1. looking at this there is no problem in creating a wifi network. Try switching to dynamic ip on mobile.

      Delete
  23. I switched to dynamic IP, but it hangs at "Obtaining IP address" and disconnects. Switched to Static IP again, it connects but again i cannot open any website in my default browser as well as Dolphin Browser.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. I did an ipconfig of my computer, here is what it says:

      C:\Users\Rishabh>ipconfog

      Windows IP Configuration

      PPP adapter BSNL Internet:
      --Connection Specific DNS Suffix:
      --IPv4 Address..................: 1XX.XXX.XXX.XX
      --Subnet Mask...................: 255.255.255.255
      --Default Gateway...............: 0.0.0.0

      Ethernet Adapter Local Area Connection 2:
      --Connection Specific DNS Suffix:
      --IPv4 Address..................: 192.168.1.100
      --Subnet Mask...................: 255.255.255.0
      --Default Gateway...............: 192.168.1.1

      Wireless LAN Adapter Wireless Network Connection 2:
      --Connection Specific DNS Suffix:
      --IPv4 Address..................: 192.168.XXX.1
      --Subnet Mask...................: 255.255.255.0
      --Default Gateway...............:

      ===================================================
      Clearly out here my LAN connection is Local Area Connection 2, and i am using the same settings. I have shared the connection "BSNL Internet", which depends on my LAN (It obtains IP and DNS automatically). Still no internet in my android.

      Edit: Deleted last reply as it had some wrong info.

      Delete
    3. as i suspected, you giving wrong ip to your phone.

      try using the "Wireless LAN Adapter Wireless Network Connection 2" ip

      so in this case your static ip will be, 192.168.XXX.2 (the last byte can be any digit from 2 to 255)

      Please try this static IP, and let me know the results.

      Delete
    4. and for sharing, share BSNL with Wireless LAN Adapter Wireless Network Connection 2.

      LAN has no role here, in my case above, I was connected with LAN internet. This is the reason why I shared LAN. In your case you are connected to internet using BSNL connection. So whatever i did with LAN connection in the tutorial you have to do it with BSNL and share it with Wireless LAN Adapter Wireless Network Connection 2.

      Delete
    5. i tried using Wireless Network Connection 2's IP address, it disconnects immediately. As in the settings, i tried removing the gateway, it hangs at obtaining IP address.

      Delete
  24. Thank you very much! Finally have a good connection in my room! YAY! Took quite a while for my phone to connect and get an IP, but I think that may have been due to the custom ROM I am using. BTW It's a HTC One X on windows 7 ultimate 64bit.

    ReplyDelete
    Replies
    1. You are welcome. Thank you for sharing this information.

      Delete
  25. Bro.. Thank you very much you have solved my problem completely.. Thanks for sharing your knowledge and wisdom.. :)

    ReplyDelete
  26. Windows 7 Ultimate
    Samsung Galaxy Pocket (S5300)
    3G USB Modem internet connection
    Android 2.3.6

    Connectify did not work, Virtual Router did not work.

    So imagine my surprise when after months of searching for a solution, I followed your instructions and then WOW, i'm online with my mobile using my laptop's USB Modem.

    Then imagine my frustration when after disconnecting and trying again, I could not get it to work again! Either it hung on obtaining ip address, or it connected but there was no internet! Grrr!
    But I stood by the rule that if it worked once, it could work again.
    So I tried many different variables, and I can say that I have found some consistency and am able to make it work, here is how:

    Before I turn on my phone's WiFi or start the Hotspot, I make sure:
    1) Static IP in WiFi advanced settings is unchecked
    2) My Internet connection adapter's properties is set NOT to share.

    Then I run the script to turn on the Hotspot, and open my Network and Sharing center and it should say that the Hotspot is "Identifying..." during this time, I will turn on my WiFi on my phone and connect. I should be able to connect.

    Once connected and once the Hotspot is finished Identifying, making sure the connection is "Home" (not Work or Public) and join the homegroup (why not?). And also make sure that I "Allow" everything because I'm running a firewall and it gives me warning messages.

    Now is the time that I turn on sharing in the Properties of my Internet connection adapter.

    Then I go to my phone's advanced wifi settings again and I check Static IP.
    I also notice the IP number that my phone should have automatically obtained.
    Let's say it's 192.168.123.21, just as an example.

    So I need then to go to my Hotspot adapter's properties, then click properties for Internet Protocol Version 4, then change the IP address to match the 3rd number in the phones address, and make the 4th number 1, ex: in this case, you would change to 192.168.123.1

    Then I disconnect and connect again internet.

    Then....as Doc Emmett Brown said, "Don't worry. As long as you hit that wire with the connecting hook at precisely 88 miles per hour, the instant the lightning strikes the tower... everything will be fine...."

    ReplyDelete
  27. Hi I'm Using Windows xp and not found any free software that make it work
    My Phone is SAMSUNG Galaxy Y

    ReplyDelete
  28. hi, with my phone it show limited connectivity , i have enabled the sharing but still the same. i even try the application but no good.

    ReplyDelete
    Replies
    1. Gaurav, there are a number of reasons why this is happening.
      I am preparing a troubleshooting guide right now. This application is working for many, however at times there seems to be a problem of limited or no internet connectivity. If your phone is able to connect successfully, but you are not able to browse then there might be an issue with network sharing. Please verify that the network is shared properly

      Delete
  29. Thanks, Working without any problem(xperia x10)

    ReplyDelete
  30. Hey can you elaborate more on connection in XP. The bat files are not creating any connection in the network wizard. Also when I try to install the Android WIFI SW the error says there is .Net Framework etc

    ReplyDelete
    Replies
    1. unfortunately the netsh command on windows xp does not support virtual wifi creation, therefore this method is limited to only vista and windows 7 users.

      The wifi software requires .NET framework which you can install from the link provided at the end of this post: http://seevisionc.blogspot.co.uk/2012/07/androidwifi-09-is-live.html

      Delete
  31. okay, I am not aware of a lot of technical details. So could you help me with the following.
    I connected, but I was stuck at obtaining IP address. So I read something about static IP in comments, which I guess means changing selecting that option of using my own IP address in wireless connection 2 properties.
    Now I dont know what values to put there.
    I put random stuff like 192.168.1.32 and default gateway as 192.168.1.1 and did the same in my galaxy nexus. so they connected but no internet access.
    and yes I have enabled sharing in Local area connection through wireless connection 2
    SO please tell me what am I doing wrong.
    Thanks

    ReplyDelete
    Replies
    1. I have mentioned this in my previous comment and I quote here
      "Muhammad Asad29 July 2012 10:35

      as i suspected, you giving wrong ip to your phone.

      try using the "Wireless LAN Adapter Wireless Network Connection 2" ip

      so in this case your static ip will be, 192.168.XXX.2 (the last byte can be any digit from 2 to 255)

      Please try this static IP, and let me know the results."

      The XXX in the ip has to be different than the network you are trying to share. There can not be random entries in the ip as two devices can not have the same ip.

      Usually this step is only used when the phone is have trouble obtaining an ip. In your case (if I am not wrong), the phone is connecting successfully but is not able to access the internet. This might be a problem relating to sharing options. Please check and verify if you are sharing the internet as mentioned in the above steps. A good and easy way to do this is to try connecting another laptop to the wireless network.

      Delete
    2. As an example here are my ip setting which I am currently using:
      Wireless LAN adapter Wireless Network Connection 2:

      Connection-specific DNS Suffix . :
      Link-local IPv6 Address . . . . . :
      IPv4 Address. . . . . . . . . . . : 192.168.137.1
      Subnet Mask . . . . . . . . . . . : 255.255.255.0
      Default Gateway . . . . . . . . . :

      Ethernet adapter Local Area Connection:

      Connection-specific DNS Suffix . : hotspot.localnet
      IPv4 Address. . . . . . . . . . . : 192.168.161.37
      Subnet Mask . . . . . . . . . . . : 255.255.255.0
      Default Gateway . . . . . . . . . : 192.168.161.1

      ip obtained on my phone using these settings on pc is:
      192.168.137.92

      Delete
  32. hi... Muhammad Asad!! bro i have done all things till now but not getting access to internet throuh my android phone (gingerbread 2.3.6)
    i am telling you what i did:
    1) set up a hosted virtual network though cmd line
    2) set sharing to allow other n/w users to use this computer's internet connection
    3) its finish with with laptop part

    I want to tell you here that i am using a wifi connection on my laptop!!

    now android phn is getting ip n is connted successfully (getting IP prob solved by reading this thread thanx)

    but internet access is still not possible on phone!! :-(

    any suggestion?

    ReplyDelete
  33. one thing more..... i check out the hosted n/w 's status!! it get packets when i try to access internet on phone! received pckt no is increasing but sent pckt remains fixed to NO 42!!

    ReplyDelete
    Replies
    1. The problem might be with your phone trying to obtain a dynamic ip.
      Could you please try using a static ip as mentioned in the comments above.

      Please let me know if this works.

      Delete
  34. Hello everyone,
    I apologize for delay in reply.
    I am currently preparing a troubleshooting guide for all those who are having problems. I will be using all the information from the comments above.

    It is a request to everyone coming to this page to atleast leave a comment here with the following information. This will help me improve the guide.

    1. Phone Model
    2. Android Version
    3. Windows OS

    Thank you.

    ReplyDelete
  35. HTC Explorer Arabic ROM
    2.2
    WIndows 7

    ReplyDelete
  36. Please tell similar codes for win vista
    netsh wlan stop hostednetwork
    does not work in vista:-(

    ReplyDelete
  37. Everything is working fine , but the wifi on the android mobile gets disconnects frequently , I again have to toggle the wifi on my android mobile , I also tested with other mobiles as well. But the virtual wifi has internet access. Kindly help as soon as possible , I am dying to get a solution of it

    ReplyDelete
  38. hello,
    I'm having trouble connecting my sony xperia u (ICS) to my laptop's ad hoc. connection. but it's because android doesn't support ad-hoc connection.
    anyway
    i tried what you've suggested up there. mine's win vista and this is the error i find
    "The following command was not found: wlan start hostednetwork"
    any solution to this?

    ReplyDelete
  39. Good job,
    It's working, using Windows 7 SP1 32 bit, Samsung Galaxy S Advance (I9070, gingerbread).
    Thank you for finding and sharing this solution.

    ReplyDelete
    Replies
    1. Thank you so much for sharing this information.

      Delete
  40. Im using win7 64 and xperia arc, i disabled on the phone what u said, run androidwifi, share connectio to it. My phone can see the network but when i try to acces it network disappears, after 5sec it appears and my phone aggain try to connet but it cant. Any suggestions what to do?

    ReplyDelete
    Replies
    1. make sure you supply a passkey which complies with wpa key standard
      you can generate a key from site like: http://www.yellowpipe.com/yis/tools/WPA_key/generator.php

      Delete
  41. Hi,

    neat work, but I got stuck. Attaching a Samsung Galaxy Tab2 seems to be impossible. It works fine with normal wireless routers, but can't connect to mhotspot/connectify/etc so I started to experience with static IPs.
    This way it connects of course,but internet is not accessible.
    Shouldn't the "wireless network connection 2" have a gateway? Now it has none,maybe that's the reason?

    ReplyDelete
  42. This comment has been removed by the author.

    ReplyDelete
  43. hi i m using xperia active. i done all thing that you have told to do. hotspot is detected by phone but it keep conecting and signal stranth is poor.. what to do?
    my phone xperia active st17i
    android ics 4.0.4
    os windows 7 ultimate

    ReplyDelete
  44. Thanks for a great guide and some really helpful tips! I'm running Windows 8 Pro and trying to get my Galaxy Note II (Android 4.1.2) and Nexus 10 (Android 4.2) to connect. My Internet connection is being supplied by an O2 USB modem and this is what I want to share out.

    I have tried Connectify, Virtual Router and all of the others with varying success. To be honest I would prefer to us Windows to do this if at all possible. For anyone of the ones that worked none of them including the Windows only solution stay connected for any great amount of time, this to me is far and away the most annoying thing about all of this!! I can connect and browse the Internet fine and then all of a sudden I loose the WiFi connection or I have the WiFi connection but it won't connect to the Internet for me? I have tried static and dynamic IP address assignment and still the same thing :-(

    Disabling Location Services in Android has helped but again it either disconnects from the WiFi or stops connecting to the Internet!? I would love for this to work properly and stay connected.

    Would the fact I'm using a USB broadband modem have anything to do with it? I doubt it as in fairness the USB modem stays connected all the time and never drops the connection.

    Cheers,
    Mark

    ReplyDelete
    Replies
    1. Hi Mark,
      Sorry for late reply, I have been busy with a lot of things lately.

      Of all the people reporting success in this section, I have come across many people reporting successful operation with USB dongles. So it definitely is not your USB modem.

      Coming back to disconnection/no internet connectivity issue, many people have reported this issue. This seems to be an issue with the drivers implementation for the wireless card. However there are still some things you can give a try and see if it works:

      1. Unshare the connection, restart your pc and try sharing it from the beginning

      2. I have noticed that on my HP G6 laptop, I lose connectivity when I use my laptop waking up from a sleep mode. The laptop just cant create a virtual router. For this, a simple restart seems to fix the issue in my case.

      3. Try connecting another laptop or non android device e.g. iphone/ipod/ipad with the network, to check whether the problem is with the network or the phone.

      4. use ipconfig to check whether the ip of virtual wifi conflicts with the ip of USB Modem

      5. The issue can also arise if passkey is not complying with the wpa encryption standard. Unfortunately for this method I have not included any checks for this. To make sure you have a correct key, use wpa key generators like : http://www.yellowpipe.com/yis/tools/WPA_key/generator.php

      I hope this will help you in fixing the problem.

      MAsad

      Delete
  45. thanks!I am using Galaxy tab 2. I was connected with your method
    but internet was not working. so I set static ip for tablet and pc. Now it works.

    for pc(local area connection):

    ip address: 192.168.137.1
    subnet mask: 255.255.255.0
    default gateway: blank
    preferred dns:8.8.8.4
    alternate dns:8.8.4.4

    on tablet:

    ip address: 192.168.137.165
    gateway: 192.168.137.1
    dns 1 : 8.8.8.4
    dns 2 : 8.8.4.4

    ReplyDelete
    Replies
    1. Thank you for sharing this information, I am sure this will help a lot of people facing the same problem.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Phone Xperia S
      PC OS Window & 32bit Ultimate

      i follow this instruction:
      successfully connected
      but i can't connect internet network on my android phone
      can you help me?

      Delete
    4. same problem as alexander is being faced, in samsung galaxy grand the ip address cannot be set, please help!!

      Delete
  46. I used 8digits password from key generator and I can connect but it disconnect immediately
    In the taskbar icon when I click it show "Currently connected to: No network access"
    I use usb modem
    Please help me with this
    Android 2.3.6 on Samsung Galaxy Ace 2 and Win 7

    ReplyDelete
    Replies
    1. Val thanks for sharing this information. Please see the comment above by mottomotto7, it details the solution to your problem

      Delete
  47. Thank you very much for this!!! It is really the only free of charge (and straight forward) application available.
    Cheers!!!

    ReplyDelete
  48. hi. . . . writing for second time . . . . i recently had to format my laptop and now after doing all the above steps i am still unable to have Wireless Network Connection 2.please suggest the needful steps please

    ReplyDelete
  49. Ok I have been having a similar issue as everyone else in that my Android tablet can connect to my virtual router, but the tablet is unable to resolve DNS addresses. I haven't tried turning the location services off on the tablet, but that will be next.

    My Tablet is running Jellybean
    My Laptop is running Win7 Pro 64

    The following is my IP info:

    Local Area Connection 3 Internet active / Shared:
    10.3.27.47
    255.255.255.0
    10.3.27.1
    DNS 10.3.1.6 / 10.3.1.5

    Wireless connection 2 (virtual mini port adpr)
    192.168.137.1
    255.255.255.0
    No Gateway or DNS

    Tablet connection:
    192.168.137.2

    Any ideas?

    BTW, to resolve the Mini port adapter hanging or in an unavailable state, go to Hardware manager and uninstall the adapter. Then disable yor regular WIFI adapter then re in able. The mini port should reinstall itself and allow the NETSH WLAN START HOSTEDNETWORK part

    ReplyDelete
    Replies
    1. Hi Brian,

      Thank you for your comment.

      The solution is to use a static ip on your tablet.
      Specify the following settings and let me know if it works:

      On Tablet/Mobile:

      ip address: 192.168.137.2
      gateway: 192.168.137.1
      dns 1 : 8.8.8.4
      dns 2 : 8.8.4.4

      Delete
  50. Hi

    My laptop was connecting to android wireless network fine just before a few days, my company seems to have changed network policy and i am no more able to work from home as the laptop is not able to connect to the internet connection of my phone. The connection says "Identifying.." and doesn't proceed beyond that. Any idea?

    ReplyDelete
  51. Hello !

    I have Windows 7 x64bit, trying to share a wifi connection over an ASUS Padfone 2 running Android 4.1.1

    It gets connected but no internet service at all. I tried with a static IP, same problem =(

    To be honest I am a bit lost between AndoidWifi and this tutorial, which script do I have to make / run and which I don't have to, you should make a recap tutorial ! :)

    Help please ! :/

    Thank you !

    ReplyDelete
  52. Hi!

    Im using windows xp and trying to share the internet with my samsung galaxy S3 mini.. when I rightclick the Local Area Connection, there are only two tabs, the general and advanced..how to find sharing?? And when I right click the TurnWirelessOn.bat I made, there's no run as administrator..what should I do???

    thanks! :)

    ReplyDelete
  53. Replies
    1. good to know that its still working!!

      Delete
  54. Hi. I successfully made a hostednetwork and my phone recognizes the connection and it even gets an ip address, dns and stuff.. My laptop shows that I have internet connection shared thru a 3G USB dongle to my hostednetwork. But when I browse using my phone it shows "no internet connection." I have an iphone 4s.. I am using Win 7 Professional 32 bit..

    ReplyDelete
    Replies
    1. If you have an iphone or any apple product then you can use Ad-hoc network to share connection with your phone. This method is much simpler and easier to set up. However it will not work with any android device you may have.

      I googled this and found the following link which shows the details on how to set up connection using this method: http://technolionrg.wordpress.com/2010/06/05/connect-iphoneipod-touch-to-internet/

      Delete
  55. 1. Acer Aspire One using Windows 7 Ultimate
    2. Xperia P
    3. ICS 4.0.4
    4. DSL Network for sharing


    I have a problem connecting my Xperia P with the HotSpot created. I have used both the method suggested by you but it's not working out. I have even tried using Connectify, Virtual Router, Winhotspot but all in vain. Please help me.
    My problem is that my phone just tries to get connected but is not able to set a connection. I tried using static IP method as well but of no use.
    Pleaase suggest what am I suppose to do to resolve this issue.

    ReplyDelete
    Replies
    1. Looks like the problem is not dependent on software side, might be because of incompatibility of hardware. There is less i can do, but if your android is rooted you can make it work with wifi adhoc network..

      Delete
  56. System: Windows 7 SP1
    Mobile Model: Samsung Galaxy S Advance
    Mobile OS: Android 4.1
    Connection: CDMA USB Modem connection
    System: Dell Inspiron N5010

    Showing the hosted network settings

    Hosted network settings
    -----------------------
    Mode : Allowed
    SSID name : "Connectify-Me"
    Max number of clients : 20
    Authentication : WPA2-Personal
    Cipher : CCMP

    Hosted network status
    ---------------------
    Status : Started
    BSSID : 8c:a9:82:4f:13:6b
    Radio type : 802.11b
    Channel : 11
    Number of clients : 2
    98:52:b1:a7:e9:5c Authenticated
    08:37:3d:b2:c8:13 Authenticated

    ReplyDelete
    Replies
    1. thanks a lot. Really appreciate your effort in putting this down. I am sure someone who has similar setup might benefit from your information.

      Delete
  57. Wow! I have to thank you for that post!
    I was using Connectify which is a heavy solution, requiring software installation, and a software running all the time.

    I knew it was possible to create a virtual router natively in Windows, but I didn't know how.

    Anyway, a huge thank you!

    PS For information, it worked with my HTC One XL and my PS Vita.

    ReplyDelete
    Replies
    1. Glad to know that.. Many thanks for leaving a comment.

      Delete
  58. You are brilliant it works wonders you should put a donating box in youe webpage! works great for my fly320 tablet.

    ReplyDelete
    Replies
    1. Duly noted ValenteFV. Many thanks for your comment. I will try to add donation button soon.

      I am glad that this is working out great as it is for everyone.

      Delete
  59. 1. Windows Version: Windows 7 64bit
    2. Mobile Model: HTC One
    3. Type of Internet Shared: LAN
    4. Android Version: 4.2.2
    Note: When I changed the password of the network (I used the program not the networks) I had a problem connecting to the network through my phone, when I used the default password it connected.

    ReplyDelete
    Replies
    1. thanks for sharing this information.
      This method does not check for valid WPA passwords. So if you enter a password which doesnt comply with the wireless protocol, the connection wont be established.

      In order to provide a valid password, please google for WPA password standards and make sure your password meets all the requirements.

      Alternatively you can use a WPA password generator found here:
      http://www.yellowpipe.com/yis/tools/WPA_key/generator.php

      Delete
  60. 1. Windows Version: Windows 7 64 bit
    2. Mobile Model: Huawei Honor
    3. Type of Internet Shared: Mobile Broadband
    4. Android Version: 2.3.6

    It doesn't work. Authenticating and disconnect, to-and-fro. No static IP enabled. Use password from WPA key generator (8 chars).

    FYI, my PC has two Microsoft Virtual WiFi MIniport adapters. When androidWifi is running, the second miniport was enabled. But I had set the sharing of my Mobile Broadband adapter to the 2nd miniport adapter.

    ReplyDelete
  61. This is fantastic. I was so tired of the bull*t of Connectify.
    Specs:
    Win7 Pro
    Nexus 5 stock software (android 4.4.2)
    LAN shared

    Followed instructions, works like a charm. I just hope it stays this way :)

    PS: No need to change location settings on my phone.

    ReplyDelete
  62. hello....asad
    i using a proxy server(192.168.1.103) with a port no.(2128). my OS is window 7 and my mobile is XPERIA M with 4.1 jelly bean. when i connect to with ssid (using your application) my mobile shows a message "obtaining ip addres" and remain for long time... so no any connection estabilished

    ReplyDelete
  63. Worked perfectly with #Windows 8.1 and Sony Ericsson #Xperia™ Mini, #Android 4.04. Thanks a lot!

    ReplyDelete
  64. Hi, can you help me to solve a thing? I'm using proxy setting on my PC browser and it's working well. When I try to share the connection as usual, my Android can only connect to the WiFi but can't access internet. I've tried configuring the proxy setting on my Android Wifi setting (I input the same proxy setting as my PC) but it doesn't work. Can I use the AndroidWifi while I'm using proxy?

    ReplyDelete
  65. My Wireless coneection 2 is not Working

    ReplyDelete
  66. hello muhammad asad.
    i just found your program, and ii think it'll be great.
    but, i am still stuck in connecting my device.
    it's says connecred, but there's no connection to network
    i already tried your advise you post, but still cannot connect.
    heres the pic.
    http://i.imgur.com/dnXbH31.png

    ReplyDelete
  67. bro when i run the the turnonwireless batch file no wireless is created in network conncetions plz help

    ReplyDelete
  68. Hi,
    I am developing an android application. It has to retrieve some data from WCF. I have hosted my WCF in my Laptop(Windows 7). Is it possible to get the data from WCF through androidwifi to mention the url like http://Laptopip/wcfservice.svc from my android device.

    Thank you
    Balamurugan

    ReplyDelete
  69. Yep, It works to share internet, But my smart phone cannot connect , it display authentication problem, I try to reboot my phone and pc many times but it didn't connect, please help?the os of my pc is windows 8.1 , please help what's wrong with my pc?

    ReplyDelete
  70. Thank You! it work fine with MaxTelecom WiMax USB Dongle shared to Wi-Fi adapter TP-LINK TL-WN722N. I conncted my notebook and phone (Samsung Galaxy S2). Cheers!

    ReplyDelete
  71. For me, I am successfully able to create the connection on my laptop but on my Android phone, when I am trying to connect to the hotspot, it is showing Authenticating ...Obtaining IP Adrress, Pls help

    ReplyDelete

  72. i am using a samsung galaxy s3 and i have tried setting off my location services, turned off my wifi power saver, did make sure that lan is shared to the hostednetwork. all these being done or multiple times yet i cant use internet on my call although it gets connected to it.
    please help

    ReplyDelete
  73. how are you, dude my problem is that my android s5 can´t see the ad hoc at all! is their a fix for it?

    ReplyDelete
  74. Good points. Was fun to read and learn this way. Nowadays all the laptops are with wifi and even desktops are with wifi. Thanks for sharing your input and keep writing more on other laptop service issues.

    ReplyDelete