Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,785,193 Members 36,476 Now Online
XDA Developers Android and Mobile Development Forum

[Guide] Alternate to Ad-Hoc Wi-Fi Network for your Android Device

Tip us?
 
Harsha Raj
Old
(Last edited by Harsha Raj; 16th February 2013 at 02:40 PM.)
#1  
Harsha Raj's Avatar
Senior Member - OP
Thanks Meter 1,231
Posts: 4,228
Join Date: Jun 2011
Default [Guide] Alternate to Ad-Hoc Wi-Fi Network for your Android Device

1. Introduction:
 
-This guide is for those who do not have a Wi-Fi router in their network. The guide will teach you how to access the internet in your Android device, where by the internet is only accessible in your Laptop though LAN.

-Before when Galaxy S2 had Gingerbread, there was a modified WPA_Supplicant here. However it does not work with ICS and above and no one else have come up with a updated mod.

-However if you have Windows 7/8 [does not work in XP] then you can try setting up a Virtual Wi-Fi adapter which works as good as a WI-Fi access point.

-There are many other ways like Connectify and other softwares, but they have not worked for and more over why to bloat the system when there is a native feature support in PC.

-There is another alternate called reverse tethering. But that will require root and it only works for me sometimes. More like when I get lucky. You can try this app or this guide.

2. Requirements:
a. Windows 7/8
b. Administrative access for Windows PC
c. Wi-Fi enabled Laptop or an Desktop with Wi-Fi adapter

3. Steps:
Step 1: Press start and type cmd and right click on it click on "Run as Administrator"

Step 2: Type netsh wlan set hostednetwork mode=allow ssid=NAME key=PASSWORD and press enter
Note: NAME is the name which you want to give for the WI-Fi accesspoint and PASSWORD is the security key which is required for accessing the Wi-Fi AP in Android device. Also the password should be at least 8 character long.

Now wait till you get three sets of line confirming the command as attached in screen shot. It sometimes may take around a minute

Step 3: Type netsh wlan start hostednetwork and press enter. You will again get a confirmation message. By this step the new Wi-Fi access point will be broadcasting and when you scan it in you Android device it will appear in the list
 

Step 4: There is one more step to make the internet pass through the newly created Wi-Fi access point. The internet should be shared via LAN adapter. To do that follow the steps as below:
a. Start -> Run (or press Windows key + R)
b. Type ncpa.cpl and press enter
c. You will see Network Connections now
d. Here you will find a new network adapter called "Microsoft Virtual WiFi Miniport Adapter". This one is created when the "Step 3" is done as above. Note down the connection name. In my case it is "Wireless Network Connection 2"
e. Now identify the one which is connected to your LAN network where internet is accessed (this can be LAN adapter, WiFi adapter or even dialup connection in case of tethering)
f. Double click on that connection identified under step (e)
g. Click on "Properties"
h. Click on "Sharing" tab
i. Tick on "Allow other network users to connect through this computer's Internet Connection"
j. Under the drop down list for "Home networking connection" select "Wireless Network Connection 2" [or which ever it is in your case]
k. Click on OK and close all the dialogue boxes
 
[

Step 5: Now scan for Wi-Fi in your Android device and you can find the Wi-Fi with whatever SSID you created. Connect to it and enjoy the LAN internet in your device.

Note: If you wish to turn off the Wi-Fi AP you created then you can type netsh wlan stop hostednetwork in the command prompt and press enter. The next time you restart your PC you can directly do the "Step 3" above and you are good to go.

Also you if you wish to change the SSID and/or password later do only the "Step 2" and "Step 3" as above.


4. Troubleshooting:

1 - Wi-Fi is not turned on in PC
You might get an error stating as below when you try the "Step 3":
 

Quote:
The hosted network couldn't be started.
A device attached to the system is not functioning.
This is because the WI-Fi adapter is turned off in your PC. Just turn it on which usually will be a physical button or a function key in your keyboard. Now try "Step 3" again and you shouldn't be getting the error.

2 - Insufficient resources error
You might also get an error stating as below when you try the "Step 3":
 

Quote:
The hosted network couldn't be started.
The group or resource is not in the correct state to perform the requested operation.
This can happen if the Virtual WiFi Miniport adapter is not working properly. Try the below steps to resolve it:
a. Under network connections, if you already have a Virtual WiFi Miniport adapter then make sure its not disabled. If yes enable it back by right clicking and selecting enable.

b. OR - if you don't find the WiFi Miniport adapter at all then do as below:
i. Open Run and type "devmgmt.msc" and press enter
ii. Now you will get Device Manager window. Here expand the Network Adapters tab.
iii. Identify the actual WiFi adapter and right click on it and select disable.
iv. Now right click on it again and select enable
 

After this the adapter settings will have rested and the "Step 3" should be a no problem.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This is my second guide here in XDA. Hope it was useful and helping you enjoy the internet in your device. Do post your comments here if you have tried it out. Also do not hesitate to post here for any queries.

I also request you to look at my first guide Access Windows PC files directly from Android through Wi-Fi.

Thank you for reading.

Change log:
v0.1 [07-Oct-12]
-Initial guide
Attached Thumbnails
Click image for larger version

Name:	1. CMD.jpg
Views:	2507
Size:	24.8 KB
ID:	1382594   Click image for larger version

Name:	2. Sharing.jpg
Views:	2106
Size:	29.1 KB
ID:	1382595   Click image for larger version

Name:	3a. TB1.jpg
Views:	1866
Size:	28.7 KB
ID:	1382596   Click image for larger version

Name:	3b. TB2.jpg
Views:	1730
Size:	30.1 KB
ID:	1382597   Click image for larger version

Name:	3c. TB 2.1.jpg
Views:	1931
Size:	25.4 KB
ID:	1382598  


ROM: SlimSaber - Android 4.4.4 Kernel: Stock

History: Nokia 3100 > Nokia 6230i > Nokia 6111 > Nokia 3100 Classic > Nokia 5700 > Nokia 5230 > Samsung Galaxy S > Samsung Galaxy S II i9100

Secondary Device: Motorola Moto G Dual SIM - ROM: Stock Kernel: Stock

The Following 48 Users Say Thank You to Harsha Raj For This Useful Post: [ Click to Expand ]
 
Harsha Raj
Old
#2  
Harsha Raj's Avatar
Senior Member - OP
Thanks Meter 1,231
Posts: 4,228
Join Date: Jun 2011
-Reserved for guide extension-

ROM: SlimSaber - Android 4.4.4 Kernel: Stock

History: Nokia 3100 > Nokia 6230i > Nokia 6111 > Nokia 3100 Classic > Nokia 5700 > Nokia 5230 > Samsung Galaxy S > Samsung Galaxy S II i9100

Secondary Device: Motorola Moto G Dual SIM - ROM: Stock Kernel: Stock

The Following 2 Users Say Thank You to Harsha Raj For This Useful Post: [ Click to Expand ]
 
Sun90
Old
#3  
Sun90's Avatar
Recognized Contributor
Thanks Meter 8,812
Posts: 6,923
Join Date: Oct 2011
Location: MYSORE - KARNATAKA - INDIA
thats another good guide of urs ma8 keep up the good wrk

will try it out and see, thank u
"Knowledge Stays Fresh if Shared else Rots"
Please:



 
Harsha Raj
Old
#4  
Harsha Raj's Avatar
Senior Member - OP
Thanks Meter 1,231
Posts: 4,228
Join Date: Jun 2011
Quote:
Originally Posted by Sun90 View Post
thats another good guide of urs ma8 keep up the good wrk

will try it out and see, thank u
Thank you mate Do let me know how it goes.

ROM: SlimSaber - Android 4.4.4 Kernel: Stock

History: Nokia 3100 > Nokia 6230i > Nokia 6111 > Nokia 3100 Classic > Nokia 5700 > Nokia 5230 > Samsung Galaxy S > Samsung Galaxy S II i9100

Secondary Device: Motorola Moto G Dual SIM - ROM: Stock Kernel: Stock

 
Orr.Penn.18
Old
#5  
Orr.Penn.18's Avatar
Recognized Contributor
Thanks Meter 1,556
Posts: 1,500
Join Date: Feb 2011
Location: Recovery Mode
Bookmarked, will try out ASAP!
Sent by tapping the Speed Force by the The Flash
'Life is like Github, you merge, push and pull commits to make your life the best' - Orr.Penn.18

Devices:
sm-n900 | Stock 4.4.2 | Stock
xperia Z | Stock 4.2.2 | Stock
d802 | Stock 4.4.2 | Stock
xperia M | Stock 4.3 | Stock
xiaomi Mi3 | Stock 4.4 | Stock


Google Nexus 4 ROM/KERNEL/MODS/RECOVERIES Repository!
Samsung Galaxy Note 3 ROM/KERNEL Repository!
Samsung Galaxy 3 ROM/KERNEL Repository!
ICS Animation for S II
You know you're rooted when ... !
 
Harsha Raj
Old
#6  
Harsha Raj's Avatar
Senior Member - OP
Thanks Meter 1,231
Posts: 4,228
Join Date: Jun 2011
Quote:
Originally Posted by Orr.Penn.18 View Post
Bookmarked, will try out ASAP!
Do provide the feedback here

Sent from my GT-I9100 using Tapatalk 2

ROM: SlimSaber - Android 4.4.4 Kernel: Stock

History: Nokia 3100 > Nokia 6230i > Nokia 6111 > Nokia 3100 Classic > Nokia 5700 > Nokia 5230 > Samsung Galaxy S > Samsung Galaxy S II i9100

Secondary Device: Motorola Moto G Dual SIM - ROM: Stock Kernel: Stock

The Following User Says Thank You to Harsha Raj For This Useful Post: [ Click to Expand ]
 
Harsha Raj
Old
#7  
Harsha Raj's Avatar
Senior Member - OP
Thanks Meter 1,231
Posts: 4,228
Join Date: Jun 2011
Quick note:

For those who are not able to solve the issue mentioned in troubleshoot 2 in guide above here is an checkup. With admin rights in command prompt type as below:

netsh wlan show drivers

After you press enter you will get a list of line items. There check for "Hosted network support: Yes"

If it is mentioned as "No" then you need to update your wifi adapter drivers.

Sent from my GT-I9100 using Tapatalk 2

ROM: SlimSaber - Android 4.4.4 Kernel: Stock

History: Nokia 3100 > Nokia 6230i > Nokia 6111 > Nokia 3100 Classic > Nokia 5700 > Nokia 5230 > Samsung Galaxy S > Samsung Galaxy S II i9100

Secondary Device: Motorola Moto G Dual SIM - ROM: Stock Kernel: Stock

 
oliaros
Old
#8  
Junior Member
Thanks Meter 0
Posts: 5
Join Date: Sep 2012
nice try, works fine! But: I would prefer a solution that can connect directly over wifi, means ice cream sandwich can see and log on to adhoc networks. Anyway: thanx for this, oliaros
 
Harsha Raj
Old
#9  
Harsha Raj's Avatar
Senior Member - OP
Thanks Meter 1,231
Posts: 4,228
Join Date: Jun 2011
Quote:
Originally Posted by oliaros View Post
nice try, works fine! But: I would prefer a solution that can connect directly over wifi, means ice cream sandwich can see and log on to adhoc networks. Anyway: thanx for this, oliaros
Well but the thing is virtual wifi adapter is much for efficient and secured than ad hoc network. Even if you want to set up the ad hoc it will take the same amount of procedure. Just that you will be using the GUI and not the command prompt. But do note that windows 8 has no ad hoc feature

Only draw back of the this method is that you need wifi adapter supporting virtual wifi and you should be on Windows 7/8.

Sent from my GT-I9100 using Tapatalk 2

ROM: SlimSaber - Android 4.4.4 Kernel: Stock

History: Nokia 3100 > Nokia 6230i > Nokia 6111 > Nokia 3100 Classic > Nokia 5700 > Nokia 5230 > Samsung Galaxy S > Samsung Galaxy S II i9100

Secondary Device: Motorola Moto G Dual SIM - ROM: Stock Kernel: Stock

 
idoleng
Old
#10  
Member
Thanks Meter 7
Posts: 73
Join Date: Jul 2012
nice tutorial!

but on my dell latitude laptop, (I am using vista) I cannot find "hostednetwork" under netsh>wlan>set.

I can only see the following under set:
autoconfig
blockednetworks
createalluserprofile
profileorder
profileparameter
tracing
ROM: cMIUI 2.8.3
Kernel: Siyah 3.4.1
Modem: XXLPS

Tags
alternate ad hoc, virtual wifi
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes