How can I access my localhost from my Android device?

前端 未结 30 2821
面向向阳花
面向向阳花 2020-11-21 05:53

I\'m able to access my laptop web server using the Android emulator, I\'m using 10.0.2.2:portno works well.

But when I connect my real Android phone, th

30条回答
  •  感情败类
    2020-11-21 06:26

    On Windows PC You may not need to do anything else than finding out your IPv4 Address using "ipconfig" command.

    • Step 1 : Connect your phone to PC using USB cable.
    • Step 2 : Use command 'ipconfig' to find out your IPv4 Address (External IP of the Router) e.g 192.168.1.5 in my case.
    • Step 3: Just access "192.168.1.5:8080" from your phone browser. It works !

    Other Env Details : Windows 7, Google Nexus 4 (4.2.2), Tomcat Server, Grails Application.

    You should also make sure that you have the permission to access internet in AndroidManifest file :

    
    

提交回复
热议问题