Android Notes: (The most complete) method to determine whether the network cable is plugged in

Insert image description here

1. By calling the command:

cat /sys/class/net/eth0/carrier

1.1 Execute adb command in java code:

private fun execCommand(command: String?): String {
   
    
    
        val runtime

Guess you like

Origin blog.csdn.net/qq_25749749/article/details/134289112
Recommended