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

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,

Related

How to connect localhost on Mobile over local WIFI?

I have a Web API Project hosted on my local system (Windows 7) on IIS7.
I am trying to access that Web API or for that matter another website hosted on the same IIS via my android mobile phone and My Mobile phone is connected to local wifi. But this IIS computer is connected to same network via wired LAN. Though I can access my router that is hosted on "xxx.xxx.1.1" IP Address from that computer as well as mobile phone but i am unable to access the IIS website from my mobile phone.
I tried turning off my windows firewall on the IIS computer where this website is running, but this didn't help as well. Although i can access this IIS website via another computer on the same LAN.
I think the issue is related to LAN or wifi but it should not be as the network and router for LAN and wifi are the same.
Need immediate help and how can i solve this.
Thanks
Can you ping your phone from your computer? Or vice-versa?
Access your router configuration and check for any access control setting that might be separating WiFi from LAN.
OK. When it was extremely urgent today, i found the answer myself. It was D link Router problem and here is the solution. Hope this helps others.
Check option Clients isolation in Wireless -> Basic.
If it turned ON - clients from LAN wil not access Wi-Fi clients and vice versa.

Can't access to local server with Android

My problem is linked with this post : https://stackoverflow.com/questions/28982225/android-local-server-access-over-wifi/
I have a website hosted with MAMP on a Mac mini, connected to a D-Link router. I've got a Wifi-antenna (ubiquiti) which is connected to this router too, it creates a Wifi (offline) LAN.
When I try to connect to the Mac mini's IP, it displays the website from other devices (iPhone, Windows PC) but with Android it doesn't work.
I'd like to know how the developper in the link I refered did "use DNS by redirecting all domains to his custom domain".
Or if there is another way to work around this... Client devices which connects to the Wifi network shoudn't (I wish) have to configure manually their Android network parameters...
EDIT:
ngrok.io is not a solution :
clients may not have an 3G/LTE connection on their phones
the adress / IP should be the same every time the Mac reboot
Thanks in advance

Cannot browse site hosted on local machine from a mobile

I generated empty backbone application from backbone-generator on my OS X 10.9.1. Then changed the connect hostname in Gruntfile.js to '0.0.0.0' and start the app.
The issue is that I cannot access the application from Android connected to the same home wifi network. I know that my local machine ip is 192.168.1.101. So, I typed in a mobile browser 192.168.1.101:9000 but nothing is loaded.
I have found several similar questions on SO:
How to browse localhost on android device?
Android cannot access localhost?
But the answers did not help me and I cannot comment on them because of my low reputation.
Could anybody help with this issue and say what I'm missing?
It turned out that the issue reason was in the router wifi settings. The "WDS Settings" was disabled and to let devices communicate over network it should be enabled.
Questions that you reported deal with a local http server running on Android, in your case the application is running on your local machine, so it is necessary that your local machine and Android phone have IP addresses in the same subnet.
If you need to assign an IP_ADDRESS to your local machine (wi-fi interface), you can run in the Terminal
sudo ipconfig set en1 INFORM IP_ADDRESS
it may be useful for development purpose.

Android device and xampp server connection

Is there any method to access the android app database from xammp server using android device using only usb cable and no other mean, like wifi and mobile network.
I have gone through many articles and forums to find out this problem but haven't find anything helpful. I am trying to connect the database on localhost xampp from android device (Samsung Galaxy s 2) through my app. I have tried
127.0.0.1
127.0.0.1:80
127.0.0.1:8080
10.0.2.2
10.0.2.2:80
10.0.2.2:800
also tried my laptop ip address.
When i try to debug my app from eclipse on device, the app starts but when i click to get data (product list) from localhost the device just say that "unfortunately Myapp just stop working" and app is closed. This is when i am not using wifi on my device, but it works well when my device is connected to wifi. May be there are places when there is no wifi so in case usb option will be good.
install xampp
start Apache on computer where is installed xampp
run cmd.exe (menu
start -> run ...)
enter command: ipconfig
IpV4 Address is that what you need.
Input in android device's web browser the IP address (example: 192.168.0.23)
You will see xampp menu.
I'm don't belive this will be possible very easily since this would create a security risk for the pc (immagine somone charging his phone on your pc - and he's then accessing your pc just because its connected).
however, after a quick search i found that it might be possible using something called "reverse tethering" - also, it appears to be possible if the pc is running linux.
The problem is that your phone and the laptop have to share a network-connection together, otherwise localhost or any Laptops IP-adress won't be accessible. Maybe you could create an AP for your laptop (therefore connect your pc via Wifi to your Phone) - then the pc's IP-Adress should be accessible?
Maybe this Article will help you further...

Debug webservice from android app in the same network

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.

Categories

Resources