Debug webservice from android app in the same network - android

I'm developing an app for android that consumes a .NET webservice. This part is ok, I've already tested in the vm and my app does call the webservice and do what its supposed to do.
The problem is that i need to test it "live" now. As my app needs bluetooth and other stuff that the emulator can't provide I have to deploy it in my phone and try out.
The real problem is that my webservice is hosted in my computer (not in IIS). How can i connect to the webservice?
I've already set a VPN connection in my computer so that i could be in the same network. The connection was ok and i could ping my computer from my android phone (i downloaded an app for that). But i tried to call the webservice using my computer's ip and it doesn't work.
I use this address on browser: http://192.168.56.1:49365/DataUpload.asmx (where 192.168.56.1 is the ip from my computer and DataUpload.asmx is the name of the webservice)
The name of the webservice is ok and the ip too but i can't see the webservice.
Does anyone knows how to help me? I suppose is something with the port or something like that (MY FIREWALL IS DISABLED).
Thanks in advance.

Almost certainly 192.168.56.1 is your router, this is pretty much the norm. To be sure, go to your computer and use the same address in your browser there as you tried on the phone.
Post your results.
One other thing, you'll have to turn off the 'Cellular' radio in your phone to be sure it only connects via WiFi. Otherwise you'll have to find out what IP address you have at your house and point your phone at that IP and port forward from your router to your local machine.

Related

My android phone does not connect to my apache local server

I'm developing an android app that connect with a restful web service which is on my tomcat local server.
The app works well on the emulator, however, it doesn't work on my real mobile.
I use the IP from ipconfig, and both my laptop and my phone connected to the same Wi-Fi.
I tried to call the web service from the mobile browser but still, it doesn't see my localhost :(!
it shows me :
This site cannot be reached.
I searched a lot and all the solutions say that I have to connect both to the same Wi-Fi network and to use the IP from ipconfig command, which I did!
How can I fix this?
PS: I'm using 9090 as my port number, I don't know if that a reason?
Thank you.

Simplecv and Android app

I want to make an android app that makes beautiful effects on images using SimpleCV. I found this app http://github.com/victsou/simplecv-mobile-camera
I have windows, and I have installed tornado in my laptop. when I try to test the app on my android device, the app is not working although I ran the server and I changed the ip address in the app and the server code to my local ip address.
http://192.168.1.146:8000
The phone and computer are connected to the same network, but the router was not connected to the internet. Also, I tried to connect to the internet and use my public IP address, and it did not work. Can you help me to know why it s not working,please? Thank you so much.
As Xamox answered,the server was not working because of the firewall. After I disabled the firewall, it worked.

Connect Android device to web service in VirtualBox

i have in my laptop in virtualbox a UbuntuServer with a webservice at ip: 192.168.1.46, and webservice, ServerName is api.webservice, so from my laptop if i try in the browser api.webservice it works well!.
Now the problem, from the android device not work, the webservice,laptop and device are connect in the same network, from the device if i try in the browser 192.168.1.46, it tell me it works, but if i try api.webservice not work..
there are any solution?
Probably this is a problem with name resolution.
Your laptap (Windows?) is able to resolve "api.webservice", but your Android device not.
It highly depends on your infrastructure (WLAN-Router, DHCP-Server) how to solve this problem. You could perhaps provision your WLAN-Router/DHCP-Server to permanently bind api.webservice to the IP address of your Ubuntu box, so Android device can make a NS-lookup.
I suppose your Android app will connect a real Internet server in future. In this case, I wouldn't bother connecting the webservice by IP-address for test purposes.
When your app is published and used outside your local network, name resolution will work when connecting to a internet server registered in "official" DNS.

How to access the localhost via android mobile device?

I have a asp.net development server(localhost). I want to access the localhost through my android mobile phone(Sony Ericsson XPERIA). Because I have some web service methods that I want to access. I have done it using the emulator(by giving 10.0.2.2:portNo). But I don't know how to access the localhost via the mobile device.
Your help is much appreciated.
Thank You
Update: - 14-09-2012
Guyz I really need your help on this issue.....please help me.. I have a wireless router and my laptop is connected to that, and also my laptop has a static ip given to it.
I have an android phone and it also connected to the wireless router perfectly. And my web site is hosted in IIS7 and it is assigned with a port.
What I need is to access the web services resides in the web site through my android device(using the application).
I have attempted many times giving laptop IP(static IP) and 10.0.2.2 IP also. But none works. And I am really confused now.
If you know any complete tutorials or if you did this before please post it. Your help on this is really appreciated guyz. (please ignore my English if its wrong) Thank you.
You have to change the path that you have given while accessing your
Web Service.
Replace localhost by your own ip address.
You can fetch your ip address through cmd.
goto cmd and type ipconfig.
If your mobile phone and your web server are on the same WiFi network, you can do as was suggested in other comments - figure out the IP address of your development server using the ipconfig command and then use that address on your phone. Note that you may need to modify the firewall settings on your development server to allow incoming connections.
However, if your mobile phone is on 3G or the devices are just not on the same network, things get more complicated because you probably do not have a public IP on your development server and the devices won't be able to see each other.
In that case you either need to reconfigure your development server's local router (google for instructions on "port forwarding") or use a tool like https://pagekite.net/ (disclaimer: I wrote that!) to give your development server presence on the public Internet.
Good luck!
Simply visit 10.0.2.2 in your Android-browser. If this does'nt work, disable your firewall aswell.
You need to connect your Android Device ( Phone or Tablet ) via WiFi Connection with your local network.
Once the connection is establish, you can check the connection in browser by opening url http://xx.xx.xx.xx:portNo ( as answer by EvdTempel )
you need to set address as "10.0.2.2:portNr"
portNr = the given port by ASP.NET Development Server
Hey I had the same issue and resolved it form the information I found at https://forums.adobe.com/thread/1109558
use the 4 answer "4. Re: How to access localhost on ASP.NET Website from Android device"
worked for me :)
Simply visit http://your-system-ip-address/your-site name.
If it does not work then disable your firewall as well.

How to access a computer from a USB-cable-android-connected device?

I am trying to deploy and test my application on an android device which is then connected to my laptop with a usb-cable. Now, how can I target a webapp deployed on my laptop ?
knowing that my wifi is down and that I don't have the right to change router configuration to do some IP port forwarding tricks (in case you would like to suggest me to use the mobile network e.g 3G, go on internet and get back in via our router external IP address ==> which is also a little bit heavy given what we want to do here)
According to the android documentation, "the emulator" can use the ip address 10.0.2.2 to access the hosting computer but there is nothing for devices...
thanks in advance guys,

Categories

Resources