I need to test an App I wrote that's being used in a different country. This app will only work there as it communicates with the local network there. My boss has asked me to remote in and install the Android emulator on the client PC so we can run tests.
The PC's net config operates on the subnet 192.168.0.xx
The devices the app wants to communicate with are on 192.168.1.xx
There doesn't seem to be a way to get the emulator to work on the different subnet. The internet works so I'm assuming this is blindly using the client PCs internet connection (on 192.168.0.xx). In which case if I change the client PC's network configuration I'll lose my remote connection and cannot continue my work!
I've had a Google to no avail.
Any suggestions?
Thanks.
Related
Is it possible to connect my Android phone (Redmi Note 7) directly to my Windows (10) PC in such a way that I can make network connections to the PC from the phone, with/without a per-existing WiFi network?
My specific issue is that I want to be able to connect the camera of my android phone with the web browser using a specific IP address. This IP address when typed on the browser would open a screen that would help us to connect with the android device, basically feeding in everything what the android device camera sees.
I've already done my work on the camera2API interface work, I just need some help with the network connection part.
Ideally I'd like a solution that doesn't involve the Internet at all - neither from the PC nor the phone. In my particular situation, it would also be ideal if this can be done over a WiFi network connected via a single IP(same for phone and to be typed on the browser) would suffice.
I really need help with developing an android app that would help me to setup the connection between the android phone and PC using the TCP/IP protocol. There is already an app for serving such a purpose whose link I am providing below, but I have to add some security and login features on the existing app. All i am asking is how would I set up such a connection in the first place and proceed forward with the app.Also, Bluetooth provides a very less upload speed, and about the USB, i am trying to make the total process wireless. the link to the existing app: ip-webcam.appspot.com
Well, I am working at a similar app, and I use a modified web server for configuration and delivering images (I am doing it on the native side though, but I am sure there are plenty of Java web servers out there).
I want to connect to a server on my local network (10.134.0.178:80). The ip address of my machine is 10.134.3.12 and the ip address of the emulator Wi-Fi is 192.168.232.2.
Now I found out that you have to use 10.0.2.2 to connect to a server on your local machine. But the server isn't running on my local machine - instead it is a separate instace on my LAN.
My local machine can reach and ping the server without problems. The emulator not, but the emulator has internet access. So I can access e.g. www.google.com.
How can I connect the emulator with the server? The shown redirection rules only apply on port level. So how is this meant to be used? Other solutions only talk about a local server. Only one is talking about a similar case, but this is not working for me (no connection)
netsh interface portproxy add v4tov4 listenport=80 connectport=80 connectaddress=10.134.0.178
Additionally, I have to switch server instances (different ips/ports/addresses). So how can I use the Android Emulator in this case? To which address should the webservice calls be made? 10.0.2.2 or 10.134.0.178?
Hmmm, well, your Android app should connect to the server's address/port as it appears to the host machine running the Android emulator. I have a web server on my LAN and my emulator can access it directly. Start with pointing Chrome in your emulator at a web server on your LAN (assuming you have one on there somewhere) - if the server is on 10.134.0.178:80 then just type 10.134.0.178 in to your Chrome address bar. If that's not working then you need to look and see what's stopping it - any redirection rules getting in the way?
Don't know what the reason was, but the most plausible one is, that the server had a temporal issue. Now I can connect to my server without further changes!
One thing what still didn't work for me was ping, but it is listed under Local networking limitations:
Depending on the environment, the emulator might not be able to support other protocols (such as ICMP, used for "ping"). Currently, the emulator does not support IGMP or multicast.
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.
I need to send an image file from the mobile to the server(where the server will save it to the hard disk). I have wrote both the android mobile part and the server side. I need to test the code before deploying to the server. Will the code work if I connect the mobile to the WI-Fi network through which I can have a LAN connection to the system? Is there any way I can test the code with out using a WI-Fi connection(ie Connecting phone to the system via the usb cable and then forming a LAN or something)? Please voice your valuable opinion in these stuff.
When I was testing my server-side I didn't find any other way rather than connecting via wifi, this way it was working just fine (in your code you need to use ipv4, not localhost, just as reminder). I'm not good with network stuff, but I don't think it's possible using usb to create some kind of LAN.
Have u tried from emulator? How to connect to my http://localhost web server from Android Emulator in Eclipse
When I run my 'web project' in the browser of physical Android device , it runs successfully because both have the same internet conneciton.
What if my phone and my PC both having different internet connection. I still want to do the same thing.
I guess you are referencing to a local IP that is only valid / visible / accessible on your network. To open this IP to others you might use a service like DynDNS or share data over a server where both peers know only the server they communicate with.