Detect USB tethering on android
you can also use reflection to access the hidden function for setting usb tethering. Here is my code. ConnectivityManager cm = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); Log.d(TAG,”test enable usb tethering”); String[] available = null; int code=-1; Method[] wmMethods = cm.getClass().getDeclaredMethods(); for(Method method: wmMethods){ if(method.getName().equals(“getTetherableIfaces”)){ try { available = (String[]) method.invoke(cm); break; } catch (IllegalArgumentException e) { // TODO Auto-generated … Read more