I wondering whether exist way to get result of ifconfig and route commands result programmatically in Android device? Can I do this in non rooted device? Answer In your AndroidManifest.xml file Your code: Output You can’t reach to know whether you are connected via wifi or network using WifiManager as WifiManager only deals with wifi. You have to use ConnectivityManager.