Android - connectivity issues

I have a couple of questions about connecting on Android, if anyone has any understanding, it would be great.

1) What is the default when an application wants to connect to a wireless network? Is it wlan? And if wlan is turned off or there are no access points around it is 3g or gprs?

2) Is the device always connected to ip? Or when it is disconnected from wlan or 3g will it lose its IP address?

3) Is an application, for example, a browser, ever connected to the same ip address? Or can it be connected to several addresses for each radio, for example gprs or wifi (wlan)?

4) Can the application decide which connection to open for the socket? For example, I can create an application and decide whether to connect a socket for wlan or gprs? Or will the OS decide?

5) Finally, how do native applications handle the connection? In the same way?

+6
android wifi connectivity 3g gprs
source share
1 answer

Like on any Linux machine, you have different devices for different network interfaces - for example, on my device: eth0 for WLAN, rmnet0 for 3G / GPRS (it is impossible to connect simultaneously via 3G and GPRS). The connected interface receives an IP address, and the kernel routing tables are updated so that all packets will be routed through the connected device. Theoretically, you could use both interfaces, however, on all Android devices that I have seen, only one network interface will be active at a time (excluding transition periods when WiFi turns on or off, or when a lingering TCP connection is still active).

Usually, native applications do not care about connecting to the Internet - if there is any connection, it will work; otherwise, the application will receive a connection timeout (or a similar error).

+4
source share

All Articles