hi i"ve done my search and i know that 127.0.0.1 refers to the android loopback interface so if instead of localhost or 127.0.0.1 i should use 10.0.0.2 the thing is that my URL doesn't include my machince ip or anything like that.For example the url that i want to refer to is in this format: http://server1:81/wcf.svc and my application cannot resolve server1 because it's only a local server.It would access it normally if my sever would be on internet.
Is 10.0.0.2 what your ipconfig command returned in terminal? I would have expected something along the line of 192.168.1.x where x can be any number between 0-255.
Bellow is output from my Mac, en1 one shows that my IP on wireless network is 192.168.1.7
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
media: autoselect <full-duplex>
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet6 fe80::226:bbff:fe15:5ce0%en1 prefixlen 64 scopeid 0x6
inet 192.168.1.7 netmask 0xffffff00 broadcast 192.168.1.255
You need to provide IP of the machine on which server is running, and not some fictional IP that people mentioned on internet as example. When you get that IP you will be able to call localhost:8080/index.html as for example 192.168.0.1:8080/index.html
yes what i'saying here is that the url of my webservice doesn't include my localhost.Also i know the ip of the local server.In my search i found out that i should open the emulator with and option of -dns-server <server/ip address> and hopefully it should work
Somebody configured server you trying to use and set it. That someone said when I call server1:81 I'm calling IP 192.168.0.1 (just example). It is like daniweb.com is actually 18.104.22.168. So find IP of that server for the network and use IP of it.
Sorry for confusion, but I misread your original post and asumed that we are talking about local server