I have an Android device connected with Lan Adapter, and it lost connection very randomly. so it require me to restart network or restart the entire device to get it working back. How can I program my running Android app to restart network (if possible restart Lan adapter or network , else restart the device) when I lost network connection.
eg in linux we use ifup and ifdown