Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I am developing a webpage and would like to see how it looks on mobile browsers, preferably the real thing and not some emulator. So I thought of making my locally hosted site available over LAN. I managed to do that and can access it fine over the WLAN from another computer. However if I try the same address on my android-phone on any browsers I've tried so far I just get "Webpage not available". Also tried on IOS and it's the same thing as on Android while it's still working on my other Windows7-computer.

Why is this? How can this be solved? All devices in question access the LAN wirelessly if it matters.

share|improve this question
    
You've definitely got mobile data off and Wi-Fi on? –  Rory Feb 15 '13 at 12:50
    
Yes, definitely. I've had mobile data completely off on my htc and iphone for the last 2 years. And I also made sure global pages are working so that it wasn't anything funny like they were out of reach from the router. –  Clox Feb 15 '13 at 12:58
    
Your wifi network and your cable network might be on different subnets. Please supply the internal IP of both your android device (not working) and your PC (working). Also, try looking for a setting for this in your router. Can your PC ping your Android device? –  bigbadonk420 Feb 15 '13 at 13:15
2  
Did you try it via the site's IP-Address, or did you use its hostname? The latter might not work (sometimes there are local DNS problems, as the Android device uses a global DNS server instead of the one offered via DHCP). IP-Address should, however, work. –  Izzy Feb 15 '13 at 13:24
    
Strikes me after thinking through an answer that this is really more of a PC/networking problem and not really Android specific. Might be better off on SuperUser.com ? –  GAThrawn Feb 15 '13 at 13:33

5 Answers 5

This could be a DNS problem, Windows machines can easily find other Windows machines on the same network without needing to have explicit entries in the DNS (WINS is the normal way this is done) your Android and iOS devices will be querying DNS (presumably on the wifi router?) for the machine name your website's on, and may not be getting any answer.

It's also possible that your Windows machines are using a different DNS than your mobile clients, possibly because you're on a domain and the Windows boxes are querying an Active Directory integrated DNS server, which may not be the DNS address that DHCP on your wifi is giving out to the mobile clients.

You may also at some point in the past put HOSTS entries on the Windows boxes to point to each other, which you've never done on the mobile clients.

On your Windows boxes, open a Command Prompt and type ipconfig /all pay particular attention to the Host Name, Primary DNS Suffix and all DHCP and DNS server lines.

Firstly from your Android phone try accessing the web server using the fully qualified DNS name of the Windows box, by adding the Host Name and Primary DNS Suffix together, eg if your IPCONFIG gave this:

Windows IP Configuration

   Host Name . . . . . . . . . . . . : Computer1
   Primary Dns Suffix  . . . . . . . : MyNetwork

...

IPv4 Address. . . . . . . . . . . : 123.123.123.123 (Preferred)

Try accessing the web page at the servername http://computer1.mynetwork from your mobile devices. If that doesn't work try using the IP address of your windows, like this http://123.123.123.123

If that doesn't work then install an app on your phone that will show the details of your network connection, there are a few different apps that will do this, I use Android System Info (which is possibly overkill for this job, but works) in ASI go to the "System" tab, and expand the "Wifi" section, you should see a DHCP info here, compare the DHCP server address and the DNS server address(es) to the ones you got from your Windows machines, ideally they should match up.

share|improve this answer
    
First of all, thank you for the reply. I did try everything you said without having succeeded yet. When I do ipconfig /all on my host-computer "Primary Dns Suffix" and a bunch of "Connection-specific DNS Suffix" are all empty. Actually I've posted the whole IPconfig-result of both computers on pastebin. pastebin.com/0kqKteQw (I hope there's no security issues doing that? =) ) I did install that app on my android but now it's um, dead. I can get back with info on that later when I'm able to recharge and start it again. Sorry –  Clox Feb 19 '13 at 16:46
    
Okay, here's the update. Bummer, doesn't seem like there's any way of copying the data from that app. Guess I'll have to type it: State: WIFI_STATE_ENABLED. Current access point: SSID: NextGenTel_66, BSSID: 00:22:07:0b:cd:65, MAC: F8:DB:7F:53:49:EC, Supplicant state: COMPLETED, RSSI: -37, Link speed: 54, Net ID: 0 DHCP Info: ipaddr 10.0.0.4 gateway 10.0.0.1 netmask 255.255.255.0 dns1 217.13.7.140 dns2 217.13.4.24 DHCP server 10.0.0.1 lease 3600 seconds. Is there any more that's relevant? Hope you can see what's wrong or something? =) Thanks again, and thanks in advance! –  Clox Feb 19 '13 at 22:45
    
The problem seems to be your dns, they are outside of your lan and cannot resolve addresses within your 10.x lan. Can you reach your server by using 10.0.0.1 instead (if the webserver is located at that address)? –  ott-- Jun 18 '13 at 20:53

One option is Chrome Remote Debugging, which works through USB. You need Google Chrome both on your PC and Android smartphone, connect the phone to USB and follow the guide here.

You can view websites and also edit them live through Google Chrome Inspect.

share|improve this answer

In my case in the router settings, "Use Router as DNS" was checked by default. As a result, my Router had assigned an IP address for my Desktop on which the web server was running (which somehow I didn't check and I was trying to use the IP address assigned by my Domain DNS).

So if you are using Wi-Fi when you face these kind of connection issues you should:

  1. Login to Router page and check the "Attached Devices" section

  2. If it displays both the Desktop(Web server system) and your mobile then your are good to go.

  3. Just copy the IP address of Desktop and use it in URL in the mobile browser

share|improve this answer

Just do it this.. Use your computer ip rather than localhost or 127.0.0.1 Check your mobile and pc already in same domain. use this application to check it. https://play.google.com/store/apps/details?id=com.overlook.android.fing when open this application you can see your pc ip.if not use above @GAThrawn answer to config ip.

Your computer IP 192.168.1.2 (What ever you have) use it in your mobile phone. type it in your web browser trough the mobile.

share|improve this answer

If you are working with visual studio then the virtual server will not be accessible by LAN, you have to have IIS configured in that system or equivalent server-like webhosting software (xampp), if you have that then you just need to type the IP address of that machine in your phone browser.

share|improve this answer
    
Question states explicitly: can access it fine over the WLAN from another computer. So if I'm not missing something here, your answer doesn't seem to match? –  Izzy Jul 21 at 22:45
    
Thanks for pointing that out Izzy, I didn't really notice that, I thought he didn't manage! –  DuckStalker Jul 22 at 15:05
    
Thought as much :) Nevertheless, your answer might help somebody else, though :) –  Izzy Jul 22 at 15:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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