Setting static IP Address(192.168.55.155) on android device, results in its WiFi connection not working (no internet).
If its DHCP on the android device, WiFi (internet) works. The Gateway on the device is pointing to Wifi Router.
I have a few android devices on the WiFi router. I need to know the IP Addresses of these devices in advance, so having static IP address is one way.
What configuration is missing?
You cannot give it a fixed address of 192.168.55.### when the router gives you one like 192.168.0.### but only 192.168.0.### also. Try 192.168.0.155.
Its easy, use an APP called Fing this APP allows you to watch all devices connected to your network and their IPs.
Related
Is there a way to "fix" or set up a static ip address of the hotspot? I need to guarantee a peripheral can connect to my server socket on that ip always.
I am trying to connect a wifi peripheral device to a server socket running on my android device. I have the peripheral connected to my android's hotspot with the ssid and ssid password.
Right now as a work around I am using ip 192.168.43.1. Sources here and here say that 192.168.43.1 will is the default. However, I am under the impression that it's possible this ip address could change.
I am also wondering about doing this for iOS but one step at a time.
Many thanks in advance!
This IP Address is hardcoded for Android as you can see in the source.
if (ifcg != null) {
/* IP/netmask: 192.168.43.1/255.255.255.0 */
ifcg.setLinkAddress(new LinkAddress(
NetworkUtils.numericToInetAddress("192.168.43.1"), 24));
ifcg.setInterfaceUp();
mNwService.setInterfaceConfig(intf, ifcg);
}
However a better implementation is for your peripheral device to get the default gateway of the local network as that will work regardless of hotspot implementation.
I've got local wireless network with no internet access, and I use static IP of my router to connect from Android device. When 3G(HSPDA disabled) Android phone see and connect to the router in WiFi network (ssh), however when I turn on 3g, my phone cannot see WiFi router. Is there any workarounds for that without disabling 3G service while using local WiFi in app?
I think you might be suffering from an Android optimization. Try to go to the WiFi settings, hit the menu key and choose "Advanced", and uncheck "Avoid poor connections".
https://android.stackexchange.com/questions/46513/avoided-poor-internet-connection-even-though-signal-strength-speed-is-great
I'm building an android app for connecting two devices together, but just as general question: Since we are all connected to a wireless LAN, the IP addresses are local, not global. I'm just wondering if we can connect to a devices using it's local IP address?!
#Tina: Sure you can. The trick is to use static IP, not DHCP IP, so that it will be clear which client is identified by what IP address.
You could also use a multicast to find other devices in the same local network
I have done this successfully before but I am not sure what is going on in this case.
Case that worked:
When I am at home and I connect my computer and my phone to same wifi such that they are on the same network. I can lookup the IP address of my computer and use that IP on my android app to talk to my computer. The local IP is something like 192.168.1.5.
However now I am using a public wifi router. When I connect my computer to wifi I get an IP like 10.10.77.162. When I try to use that IP in my android app to talk to my computer it fails everytime.
What am I doing wrong? Is there an easy way around this?
You have to make sure you forward the port you connect on from your router to your local computer inside your network. Similar to when you open ports for some games such as wow.
Connect your phone the same WiFi network.
Addresses in the 192.168.* and 10.* range aren't globally accessible. They're only used for local networks. If both devices are on the network, they can communicate with each other, but they can't if only one is.
Basically this was due to the fact that I was on a public network in which the router was outside of my control. The router was blocking traffic as one would expect.
Our university (school) has a limitation that one can only connect to their network using one device per student. It has been put in place because of the poor connectivity here (I'm in South Africa). I have set up my mobile (android) as my connecting device and when I tried to use my laptop on the network by tethering on my mobile I couldn't connect. I'm guessing the IP address is checked and, since the laptop IP is different, it won't let me in.
Any idea how I could get the laptop's IP to be the same as the phone? We are instructed to use DHCP and I'm using windows on my laptop.