It's mobile website development , Use Android Simulator test , Enter in mobile browser localhost Failed to access local server !

reason :

stay Android In the system localhost Namely 127.0.0.1

stay Windows In the system localhost It's also 127.0.0.1

Android Simulator (simulator) I think of myself as localhost, in other words , The code uses localhost perhaps 127.0.0.1 To visit , Is to visit the simulator itself !

Solution 1:

If you want to be in the simulator simulator Access local computer , Then use Android Built in IP:10.0.2.2

Access instance :

Solution 2:

It's using local area network IP Address , For example, my lan IP:192.168.1.114

However, the corresponding IIS, The domain name binding configuration is as follows :

Be careful : about IIS Express Invalid access to ,Android The emulator's browser doesn't have direct access to IISExpress Project failure .

Android The simulator accesses the local localhost More about failures and solutions

  1. ANDROID Simulator access local WEB application

    One morning I just want to android The simulator can access web Applications for , But it has always been impossible , I don't know what to do . In a normal Java Web Program development , We usually use localhost perhaps 127.0.0.1 To access the ...

  2. [020] Android Simulator access local Web application

    This article attempts to solve such a problem : How to be in Android Access the local Web application ? for example , Start a... On your development machine Tomcat service , Then open the browser on your computer , By default, enter http://localhost ...

  3. Android The simulator accesses the local apache tomcat service

    1. On the official website http://tomcat.apache.org/ Upload and download tomcat, Download the corresponding files according to your own computer 2. take apache-tomcat-6.0.37-windows-x64.zip Unpack the package to this ...

  4. ANDROID Simulator access local WEB application 10.0.2.2

    In a normal Java Web Program development , We usually use localhost perhaps 127.0.0.1 To access the Web service , But if we were Android The simulator uses the same address to access ,Android The simulator will not be able to ...

  5. Android Unable to access local server (localhost/127.0.0.1) Solutions for

    [Android Unable to access local server (localhost/127.0.0.1) Solutions for ] stay Android Developing through localhost or 127.0.0.1 When accessing the local server , Will be submitted to the Java.NET.Con ...

  6. android - The simulator is connected locally tomcat

    In the use of android The real machine is trying to connect to the local tomcat When , Found no response . I searched a lot of information on the Internet , Plus I keep testing , It turns out that the simulator accesses tomcat When ,ip The concept of pc Visit tomcat With ip, The fundamental ...

  7. Android The simulator accesses the local server

    Android The simulator accesses the local server , use 127.0.0.1 Can't access , because 127.0.0.1 It's mapped to the simulator . There are two ways to access 1. use 10.0.2.2 2. Direct use Native IP Address , Such as :1 ...

  8. Android Unable to access local server (localhost) Solutions for

    stay Android Developing through localhost or 127.0.0.1 When accessing the local server , Will be submitted to the java.net.ConnectException: localhost/127.0.0.1:8083 -Conn ...

  9. android Simulator access localhost or 127.0.0.1 Report errors

    In a normal Java Web Program development , We usually use localhost perhaps 127.0.0.1 To access the Web service , But if we were Android The simulator uses the same address to access ,Android The simulator will not be able to ...

Random recommendation

  1. Struts Introduction to core technologies

    Struts Introduction to core technologies 1.Struts Internal mechanism    Struts It's based on MVC Classic design pattern development source code application framework , It passes through Servlet.JSP.JavaBean. Integrate custom tags and information resources into one ...

  2. bash shell + python Simple tutorial , Let your mac/linux The terminal is grey ~

    Prerequisite : Is already installed python, Command line support bash stay bash_profile Add function ccolor { python /Users/xirtam/Documents/tools/cc ...

  3. IaaS/PaaS/SaaS

    If you are a webmaster , Want to build a website . No cloud services , The investment you need is probably : Buy server , Install the server software , Write a website program . Now you follow the trend , Adopt popular cloud computing , If you take IaaS service , That means you don't have to buy your own clothes ...

  4. 2014.8.20break,continue, character string , Numbers and dates

    ( One )break And continue break—— Complete termination of circulation continue—— Break this cycle , So let's move on to the next cycle break give an example : // seek 100 All prime numbers within ; i <= ; i++) { ;// ...

  5. UWP Common folders

    ①KnownFolders KnownFolders.PicturesLibrary And so on ②ApplicationData.Current ApplicationData.Current.Loc ...

  6. Linux System shell Self taught programming _ The first chapter is the foundation

    Chapter one Basics shell The advantage is to deal with the underlying business of the operating system ,Python,php The advantage is to develop operation and maintenance tools ,web Interface management tools and web Business development . Handle one click installation . Optimize . Alarm script shell It's also called command interpreter , It can recognize ...

  7. centos7 And NFS Use

    NFS yes Network File System Abbreviation , Network file system . The client will mount NFS The data directory shared by the server is mounted to the local directory . One .nfs Why RPC? because NFS There are many functions supported , Different ...

  8. Python Place is transformed into latitude and longitude

    1.geopy Package download location https://pypi.python.org/pypi/geopy 2. Installation steps             function cmd, Switch to D:/python/geopy-1.11.0/ Under the table of contents ...

  9. matlab Do cluster analysis

    explain : If you want to use matlab do kmeans Clustering analysis , Use functions directly kmeans that will do . Usage method :kmeans( Input matrix , Number of categories k). Reprint 1 : MATLAB Two methods are provided for cluster analysis : 1. utilize clu ...

  10. linux Let's look at mathematical functions

    linux If you use mathematical functions like sin, Need to add “-lm” Parameter compilation , Such as :gcc test.c -lglut -lGLU -lGL -lm && ./a.out