I develop app which contains a client and a server side, so I need to test work between them. I have a real android device and I want android device to connects to emulator. I'm working at work sometimes(if I have free time of course) and at home. I have the WiFi router at home and I can connect to the real device by emulator(TCP listener running on the real device), but not vise versa(I don't know which exactly IP to use). But at work I have only hot-spot WiFi point without router. My android device connects to it fine. Even more ADB can connect to the device when adbWireless running on it. But it doesn't work, I can't connect to tcp listener in any cases. The difference between home and work is existence of WiFi router. Are there any solutions? If not why Android debug bridge(ADB) can connect to adbWireless? Thanks.
I solved the problem. I run tethering on my real device and run the server on it. Then I use a program Connection state viewer there is a link: https://play.google.com/store/apps/details?id=ru.nolesh.android.connectionstateviewer It helps me to find IP address. After that I start the emulator and the client side on it. So I connect to my server by given IP.
Related
We are building an Android App which will let it connect to other android devices via a Socket Connection through a Wifi Hotspot created in the Server Android Device.
For most of the cases, this works perfectly. However for some cases, no matter how many times we try, a device is not able to connect to a WiFi Hotspot. This issue is not device specific. A device which is able to connect now, may not be able to connect at some other time.
While we were desperately looking for workarounds, we realized that if we Switch on and off the Hotspot in the connector, then it connects immediately to a WiFi Hotspot it was not able to connect previously.
Can anyone help us understand why is this happening? Also, is there anyway we can replicate this without switching off the WiFi Radio(switching on the Hotspot switches the Radio off)?
I am programming an Android app which connects to a TCP server running on my computer using sockets. This works perfectly fine as long as both my computer and my smartphone are connected to the Wi-Fi of my router.
I want it to also work when my computer and my phone are not connected to the Wi-Fi. Therefore I configured a Wi-Fi hotspot using hosted network on my computer. My smartphone recognizes the Wi-Fi and is able to connect to it. But now my app can't connect to the server running on my PC although I changed the code to the new IP that I got by using ipconfig on my PC.
I downloaded an app named "Fing" from the Google play store. The app shows all devices in a network. It does show my computer under the right IP address. I don't understand why my app can't connect to the server running on the PC.
On the one hand, I don't think that the problem is in the app's code, because it works on the router's Wi-Fi network. On the other hand, I doesn't seem to be a setup mistake either, because Fing is detecting my PC.
Do you have any ideas what the problem might be, or any other solution for my needs?
I actually wrote the TCP server myself using c#. I configured the Server to listen to all of my computers networkinterfaces usingIPAdress.IPv6Any. I also did configure it as dual mode socket so it can accept ipv4 and ipv6 connections. I will post the code when i am back home. So the TCP server also looks ok to me.
Good day.I am trying to connect my android application to xamp. Basically I have an application that uses xamp, it works on an emulator but not on the actual device.After hours of searching, I found solutions to use tethering on usb and wifi. With tethering I get the error "adb problem, unable to communicate with device..please kill add".With wifi, it does not access my localhost.I know that someone might say this is a broad question.What I am asking is, how can I make my device access my xamp localhost?
I just mentioned the above to show what I tried and could not succeed.
If your android device and the device running XAMPP, are both on the same network, you could just use the private IP address of the machine running XAMPP, but if they're not on the same network, then you are gonna need to do some port forwarding and maybe get a static IP address.
I have built an Android application using the emulator to test. It connects to localhost to get and send data which works well. Now I want to try that application on my mobile device. I have read that I have to:
connect my computer to my router network
connect my mobile to my router network
go to the code and replace the 10.0.2.2 with the IP of my computer
Am I right? If so, is that computer's IP the IP that connects my computer to internet?
If you are developing in Eclipse, all you have to do is:
Connect your device to your computer with a USB cable
Right click on the root of your app
Select "Run As" > Android Application
If your device is connected, it should automatically run
Note sometimes you have to select whether you run on your connected device or on your emulator, but a window will display your options and your just select one.
Simple as that.
You are correct, when you simply connect to your local router you can get to your localhost by changing the configuration to point to: "http://10.0.2.2:8080"
I found the other ways to be very tedious
http://juristr.com/blog/2009/10/accessing-host-machine-from-your/
http://developer.android.com/tools/devices/emulator.html#emulatornetworking
In my house I can connect my android device to the service in my laptop as they are both on the same network. My question is, supossing I'm going to a bar and I can connect my laptop to the wifi but not the cellphone, how can I make the cellphone reach the web service on the laptop?
I tried to create an add hoc network and connectify.me but neither worked. With Connectify.me I was able to connect to the laptop from the phone but the phone could reach the web service (maybe a filter for the free version?)
Any advice?
I've already checked this: Connect an Android Device To a Web Service on Local Host and it's not the same as my problem.
Thanks in advance! Guillermo.
I haven't tried Connectify, but Virtual Router worked for me. There are some more instructions here if you need it.
My question is, supossing I'm going to a bar and I can connect my laptop to the wifi but not the cellphone, how can I make the cellphone reach the web service on the laptop?
Most likely, you can't. The bar is unlikely to have given you a public IP address, and it unlikely that you will convince the bartender to allow you to modify their firewall to forward a port to your notebook.