Why can't I connect to IISExpress from my Android device? - android

I am trying to connect to a ASP.NET WebApi service running on IISExpress through Visual Studio from an Android emulator (Genymotion specifically). I was able to set up my IISExpress bindings and firewall (as shown in posts similar to this and this) so that I could access the website externally.
I was able to successfully navigate to the service from another laptop on the network, but am still unable to accomplish it from the browser in the emulator or my own Android device (also on the network). When I try this I get a generic "Web page may not be available" message. Why can I access it from other external machines, but not the mobile devices?

Turns out Android is not able to resolve Windows hostnames so when I set up the binding to use my machine name it did not work. Once I changed it to use my IP address it was fixed.

Related

What connection use emulator in android studio?

Android studio has its own settings for connection. There I can use proxy. So this way studio will use that proxy instead of computer wifi connection to sync libraries for example.
But for example if my application I send requests to the firebase what connection will be used by emulator? It will use studio proxy or it will use computer wifi for that? And if I use real device will it use mobile internet connection or proxy?
I have tested all scenarios. So the answers are the following.
Everything local depends on local WIFI of the laptop. Android studio has opportunity to set up its own proxy but also wount work without wifi. Android emulator has a wifi spot calls AndroidWifi in settings which indicates laptop wifi.
The real device use its own connection. So these are to separate different parts. If there is no connection on laptop but there is on real device. So you can't add library but you can launch based on HTTP requests app on real device.

How do I access an external IP on Android?

I would like to access my webserver running a Polymer starter kit app from an Android devices, but I don't seem to get it to work..
Polymer starter kit comes with browser-sync, which is very nice, but
I cán access my webapp on another laptop, but when I try to access it from an Android device it just keeps loading and eventually there will be a connection timeout. I triend another android device, but still the same.
Any Idea's how to access the app(external ip) from android?
Is this only for development/debugging purposes or do you want to deploy in such a scenario?
For debugging you can use Chrome's remote-debugging capabilities https://developer.chrome.com/devtools/docs/remote-debugging.
I haven't tried but I think the ADB tool allows to redirect TCP connections as well.
Otherwise you need to teach Android the IP routes (and optionally a DNS) so the device can route connection attempts to your server.

Android device not accessing web service on local WIFI

I have made an asp web service and I am accessing it from my android application through ksoap2 library. I have successfully accessed the service from emulator by 10.0.2.2:9000/Service1.asmx.
Now I am trying to access it from my android device but I am not able to access it.
I have already hosted the service on IIS and now I can access it from emulator by 192.168.xx.xxx/Service1.asmx.
The problem is still the same Can't see any result in my android app on device that is connected to the same LAN through WIFI, although I can see my web service through mobile browser now. In addition to that I have edited the web.config file to allow all systems on LAN to invoke my web service methods.
I just checked the error. Error toast is showing java io.IOException on device still runs without any error on emulator
I would suggest to check whether 192.168.xx.xxx/Service1.asmx. is reachable via android mobile browser. I doubt that your device could be in some other ip group.

libcurl & android connecting to a web service at localhost

I've managed to connect my app to a web service but I have a problem with the android platform. (If someone doesn't know, with cocos2d-x you can make multiplatform apps)
Right now, the web service is hosted at "http://127.0.0.1:9876/ts?wsdl" at localhost.
I've managed to generate requests for it and it works great in the win32 app. The problem comes when I try to connect to the web service with the android app. It will always give "code: 7" (couldn't connect) but the funny thing is that it will work if I connect to whatever hosted server.
So I wonder why it won't let me connect to localhost, also note that I'm using the emulator since I don't have a device but I don't think that's the problem.
Any ideas?
I assume you are using an emulator instead of a phone. So when you type localhost, it refers to the ip address of the phone, not your pc. Android provides you an ip address which maps to your PCs localhost. So use 10.0.2.2. instead of localhost and it should work.

Accessing webserver running within Eclipse from outside the workstation

I run a web project targeted to be deployed on the Google Appengine locally from within Eclipse. So the server starts up and it can be accessed normally by typing localhost:8080 into some browser. Everything fine so far.
But what I need is to access it from outside, say from a friend's machine (which obviously resides in the same wireless network). So when he types the following <my-notebook-ip-address>:8080 he should reach the locally running webserver (within Eclipse). But that doesn't work!
The reason I need this is that I want my Android app running on my notebook within the Android emulator to access my locally running webserver. This is just possible by using the notebooks real ip address since localhost on the Android will be the phone itself.
Some more details
Mac OSX Snow Leopard
Eclipse Galileo
Webserver: Google Appengine (launched within Eclipse)
When launching the Appengine server from within Eclipse I can access it with: http://localhost:8080.
I cannot access it however from my local notebook (where the webserver is running within Eclipse) with: http://192.168.0.5:8080 where the IP is my IP address in the network.
I have all Firewalls disabled!
Not sure if this applies to your situation, but you can access the host PC from your Android device with 10.0.2.2 instead of localhost.
Ref.
official documentation
More specifically, in the Eclipse->Run Configurations, select your run configuration, go to the "(x)= Arguments" tab and add the text --address=192.168.0.5
By default, appengine listens only on localhost.
Try starting GAE with the address parameter, e.g. "dev_appengine.py --address=192.168.0.5"
I only wanted to point out, in case it wasn't clear enough, that the 10.0.2.2 solution proposed by JRL works great but only for emulated Android devices. Real devices have to stick to Rob's approach.
Further details in: http://developer.android.com/tools/devices/emulator.html#networkaddresses

Categories

Resources