-1

I am using angular Httpclient to call asp.net web api in ionic application all working fine its getting data from service in localhost:8200 but when it comes to real device the service response with error

ttppbb
  • 65
  • 8

1 Answers1

0

Problem Solved: Basically you need to change the url on your project where you do service. Change it from localhost:3000 to 10.0.2.2:3000. The 3000is the port's number, it doesn't need to be 3000. Then you open android studio, open emulator and run it. On the litle tab right next to the android device, theres 3 dots at the end. Press those, then go to settings, and change proxy to 10.0.2.2 and the port number to the one you are using, in this case is 3000. After that it will work. Sorry for late update on the problem! For more info: why do we use 10.0.2.2 to connect to local web server instead of using computer ip address in android client If you are behind a proxy, download an APP called pulseSecure log in, and it should be good to go.

jcmendes98
  • 148
  • 1
  • 10