Access localhost of the computer from android emulator
if you have tried to access localhost from android emulator using http://localhost or the ip address 127.0.0.1 , you would have seen an error message saying page not found. solution to this is to use 10.0.2.2 as the ip address for the localhost. you can access the localhost of your machine using this ip address.
you can see how socket are used to communicate with localhost and android emulator here.
if you have tried to access localhost from android emulator using http://localhost or the ip address 127.0.0.1 , you would have seen an error message saying page not found. solution to this is to use 10.0.2.2 as the ip address for the localhost. you can access the localhost of your machine using this ip address.
you can see how socket are used to communicate with localhost and android emulator here.