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.
Related
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 am using the NanoHttpd library to set up a server. It is currently serving a 'Hello World' HTML page.
It is accessible from the browser of the phone on which it is deployed but not on other phones or laptops on the same WiFi.
For example, http://10.54.92.228:8080 is accessible to the browser of the phone on which the server is deployed. But, is inaccessible to other devices over the network. Is there any way to enable incoming connections ?
I am working on a similar project, I have to host files over WIFI on an android device which is accessible to anyone on the same WIFI network.
The web server is working as I want.
I think the problem is with your IP-Address of the server.
For a WIFI network, the network should be in the range of 192.168.137.XXX.
What you are inputting is the global ip of the device on which your server is.
Check you local ip, and enter it with the port number and it will work.
Ping me if you need any help.
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.
I am writing an android app for a friend of mine who is a DJ. Instead of guests writing requests on a sheet of paper, he wants them to request songs through his android tablet. I have the app working through the internet but some places may not have internet. One solution was for him to bring a router and just connect the laptop to tablet that way.
My question is: how do I connect the two locally? What would the ip address for the laptop be? Where do I have to look to find it? Is there an easier way to connect the two?
I'm a pretty big networking newbie.
Thanks,
Eric
A really easy way to do this would be make a small webapp to run on the laptop, and just point the android tablet's browser to the laptop's web server. If you want a little more control on the tablet's browsing (so browser controls aren't available so people can't navigate away from the app / bring up "inappropriate" websites / etc.) create a little android app with a webview to load the webapp.
Edit: This assumes you have a router or something to create a network connection between the laptop and tablet. You could set up the router to always give the same IP address to the laptop and tablet. The specific directions for how to do this depend on the router you have - but for most you just go to the router's IP address (usually 192.168.0.1 or 192.168.1.1), login as an admin, and follow directions to set up "static" or "fixed" ip addresses for devices connecting to the network.
Depending on what other forms of communication the laptop and tablet have in common (bluetooth? IR port?) you could write an app on each computer to talk to each other without needing a router - but writing these programs is going to require writing a lot more "lower level" communication between the two apps than using HTTP.
You would have to configure the access point/router to grant a fixed IP address to the Android's MAC address and do the same for the laptop's MAC address.
Write a small web server on the tablet that refreshes the page after each new song request. Have the laptop web browser connect to the tablet's fixed IP address by visiting http://192.168.1.1, but of course replace this number with the IP address you configured. You could also reverse the roles and submit the songs via the tablet's web browser on a web server running on the laptop. And tell your client to keep a close eye on that tablet!
I have an android application that talks to a server app running on grails (Groovy on Grails).
Android app basically establishes a connection with this address:
url="http://192.168.2.53:8080/tma/majBtm/androidToDesktop";
It all works fine when both the server and the android phone are connected in the same lan network.
Now the problem arises when I want the phone to talk to the server while the phone is outside the local network (I need it to use edge).
I came across VPN networks which I think might help me out. (the server has dynamic IP)
So what i did was go to dyndns.com and created a new hostname and have the app successfully run on the server. The host I created was - tmagrails.dyndns.com
How do I make my phone connect to this network? What changes am I supposed to make in order to get things working?
Also, I really want to know if this is the right approach. If not, is there any way to get things going for me?
Please advice.
First you need to set up port forwarding so that port 8080 is forwarded to your 192.168.2.53 ip address. A google search on your router model should tell you how to do this. If you want to make your app more secure you will also need to look at SSL and TLS While this won't garantee your app is secure it will stop the network traffic to your app being easily read if you were to access it from an open wifi hotspot.