4

Is it possible to connect my Android phone (Galaxy S3) directly to my Windows (7) PC in such a way that I can make network connections to the PC from the phone, without a pre-existing WiFi network?

My specific issue is that I want to be able to browse a website that is being hosted on the PC from my phone. It's for doing web development on the PC, and using the phone to check how it looks/behaves on mobiles. There is no WiFi access point or network available.

Ideally I'd like a solution that doesn't involve the Internet at all - neither from the PC nor the phone. In my particular situation, it would also be ideal if this can be done over Bluetooth, but over USB or WiFi would suffice.

  • Do you have a WiFi router? If so, simply connect both your PC and your Android device to it. If not: start with checking our ad-hoc-network tag-wiki and its answered questions, followed by the same for tethering and wifi-direct. – Izzy Apr 13 '15 at 16:46
  • Thanks Izzy: From my previous searches, I am left with the impression that the only way I can get networking set up between the phone and PC is by using tethering, and sharing the phone's internet connection. It's a bit frustrating that I need to do this simply to connect the two machines together though, and I don't want to risk the PC consuming a lot of my phone's data. I'm asking this question to try to confirm that there is no solution. – Pryo Apr 14 '15 at 8:14
  • If I understand your problem, could you use mobile hotspot from Galaxy S3, then connect your PC to it using WiFi (no need internet connection)? It should make local network (both phone and PC get IP), then set up local server on your PC to host the site (e.g. IIS, WAMP, XAMP, etc). You can also turn off mobile data if you don't want your PC to consume the bandwidth. – Andrew T. Apr 14 '15 at 8:19
  • Matthew: I can't seem to use WiFi-Direct because I can't seem to create an "access point" with the PC. And by my understanding, it's not possible to connect (non-rooted) Android to an ad-hoc WiFi network. I also tried WiFi tethering with my data connection turned off (so as not to waste my data allowance), but neither device would ever get an IP, while trying to tether over WiFi or Bluetooth. I'm assuming that's because it couldn't connect to the internet. – Pryo Apr 14 '15 at 8:23
  • Andrew T: I hadn't actually tried this particular option! However, after I enabled "Portable Wi-Fi hotspot", I could see the network from the PC, tried connecting, typed in the password as is given on the phone's screen, and then I just get "Windows was unable to connect to AndroidHotspot1234" :/ Will try fiddling with options... – Pryo Apr 14 '15 at 9:07
1

If you are using Windows 7 try this,

  1. Create an ad-hoc network in your PC (This would help you Create WiFi Network)
  2. Connect your Android device to the WiFi network you created in past step
  3. Open the browser in your phone and type PCs IP address/your web app name (I hope you run your web app on some servers like Apache Tomcat/WAMP ..)
  • 1
    But the problem is that, android device don't search ad-hoc networks – Nirbhay Mishra Apr 12 '16 at 6:49
0

An alternative way to accomplish this without using the android device to create the hotspot connection (e.g for battery issues etc) is to use the Windows PC as the source of connection.

To accomplish this you have to host the WiFi connection in Windows (Note: Windows has a built in feature to create Infrastructure mode WLAN connection.

Simply run command prompt as admin and enter the following commmands:

  • netsh wlan set hostednetwork mode=allow ssid=xxxxx key=yyyyy

where xxxxx is user defined SSID and yyyyy is user defined password

  • Start the connection by entering: netsh wlan start hostednetwork

Then simply connect your android phone to the newly created network

  • To show status of connection enter: netsh wlan show hostednetwork and will get a window like this:

C:\Windows\System32>netsh wlan show hostednetwork

Hosted network settings

Mode                   : Allowed
SSID name              : "test"
Max number of clients  : 20
Authentication         : WPA2-Personal
Cipher                 : CCMP

Hosted network status

    Status                 : Started
    BSSID                  : xx:xx:xx:xx:xx:xx
    Radio type             : 802.11n
    Channel                : 11
    Number of clients      : 0
  • To stop connection hit: netsh wlan stop hostednetwork

Additionally may need to set up static IP address as follows:

  • Open View network connections from the Windows Start menu.
  • Open Properties on the Wireless Network Connection.
  • Select Internet Protocol Version 4 (TCP/IP) and then click Properties.
  • Manually set the IP address to 192.168.137.1.
  • Manually set the Subnet mask to 255.255.255.0.
  • Manually set the Preferred DNS server to 192.168.137.1.

Alternatively, you can achieve this with third party software like Connectify

Although paid,it also comes as a free version. It has the capabilility to create an hotpot in infrastructure mode rather than ad-hoc, hence visible to android devices.

You may want to configure the hotspot for local access like so:

enter image description here

  • After this, allow your android device to connect to the newly created connection.

Although old a post this is,its just a reference point for users with similar needs to the question:)

  • Is it possible to share an existing (say LAN) connection using the first method? – Janson A.J May 10 '18 at 6:55
  • Yes, just enable the option in ICS and choose the target LAN connection – xavier_fakerat May 12 '18 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.