1

Using the connection manager it's easy enough to see if there is a connection, however if both Ethernet and WIFI are connected at the same time it always seems to report that WIFI is connected.

I want to know if I have a connection, but also what specifically is connected. E.g. Ethernet only? Ethernet and WIFI? WIFI only? Nothing?

Is this possible in Android?

I have an app that needs to preference Ethernet (at which point it needs to disable WIFI) but use WIFI if Ethernet isn't available (as a backup).

I can get it to work on network change events but not when both are connected on app startup - in that case it doesn't know to disconnect WIFI.

Edit: not really a solution to the question but I've gotten around it by essentially turning the WIFI off to check for Ethernet and then turning it back on again (if it was on before). Not ideal but it's the only option as far as I know.

Michael Vescovo
  • 3,741
  • 4
  • 32
  • 45

0 Answers0