-1

I am using android code to get the json data from my localhost database. I am using xampp. I am able to the the json value when I run the it on my system but I am my emulator fails to get those value. The crashes I have a option force to close. I tried all the url to my knowlegde but I can't find a solution. The present url I am using now is http://localhost/android_connect/get_all_products.php and I am getting an error in Logcat localhost is refused. Can anyone help me out with this problem?

bjb568
  • 11,089
  • 11
  • 50
  • 71
RAJ
  • 229
  • 2
  • 14
  • 2
    This is a dupliate of this: http://stackoverflow.com/questions/6760585/accessing-localhostport-from-android-emulator. There has a good answer :) – joshhendo Apr 16 '14 at 05:13
  • 1
    refer this link It may help you http://stackoverflow.com/questions/14099347/org-apache-http-conn-httphostconnectexception-connection-to-http-localhost-re ----------- https://www.google.co.in/?gfe_rd=cr&ei=SRFOU5vOD8KW8QfPh4DABQ#q=how+to+connect+android+with+php+mysql+using+xampp – sathya Apr 16 '14 at 05:14

1 Answers1

0

Hey there,

It is stating that the XAMPP server is not started and listening on Port no : 80 Because default port for HTTP is 80. This states the error

localhost connection refused.

Try restarting the server.Also check that android emulator is excluded from windows firewall(Only in windows)

ShihabSoft
  • 835
  • 6
  • 15