Last active
December 7, 2022 09:09
-
-
Save btwarog/5381e70908600dd79dd4b0a0df5e8ccb to your computer and use it in GitHub Desktop.
IPv4 Addresses Android Kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NetworkInterface.getNetworkInterfaces().asSequence().forEach { nInterface -> | |
println("IPv4 address ${nInterface.displayName} ${nInterface.interfaceAddresses.filter { it.address is Inet4Address }.joinToString { it.address.hostAddress }}") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment