Best way to check if IPv6 is available
问题 What is the best way to check if IPv6 is available on the currient android phone? My currient idea is to use NetworkInterface and to enumerate via NetworkInterface.getNetworkInterfaces() but this seems to be too complicated. Is there a simpler way? 回答1: I don't know of a simpler way than using NetworkInterface if you need to check all of the interfaces, but it shouldn't be that bad: for(NetworkInterface netInt: NetworkInterface.getNetworkInterfaces()){ for(InterfaceAddress address: netInt