Android Question How do I get Ethernet status

MomoWen

Member
Licensed User
I connected to an Android device with a serial port and a network port, enabling Android to do both serial and network communication.I need to monitor my network connection all the time, but I don't know how to determine the network status (Ethernet connection status).
 

drgottjr

Expert
Licensed User
Longtime User
the easiest solution is to ping google.com from your android
device. if you get an answer, your network is good to go.

network status and ethernet connection status are not
necessarily the same thing (your android's ethernet may
be dead, but the network could be running happily). you need
to clarify (if only to yourself).

you don't say what's on the other end of your android device
(linux, freebsd, windows, etc ??). each will have its own way
of displaying ethernet status. it's easy enough to search for
online.

once you know which utility your os uses, you could set a
cron job to run that utililty periodically. you could have the
output sent to your android device, or your android device
could ask for the output.

assuming you have some kind of server running, you could
ping it from the android device. or you can simply ping google.

but as i indicated, it's not clear to me exactly what you're
looking to determine.
 
Upvote 0

MomoWen

Member
Licensed User
I tried to spell Google.com but the interface stuck (I have enabled relaxed web detection). I don't know why.But I found PhoneEvents and he can get the connection type and the connection status (mobile network, wifi, Ethernet)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…