I am looking for a way to determine the global IPv6 address on my android device for testing purpose. Now, what I have obtained a list of interfaces from Android API as the following code:
NetworkInterface netInt: NetworkInterface.getNetworkInterfaces()
netInt
actually contains a list of all the interfaces on the devices. for example, as you can see from the following list..(just a part of the list)
[dummy0][2][/fe80::d878:d9ff:fe94:eeae%dummy0%2]
[rmnet_data0][7][/fe80::e03:fac6:8232:95d6%rmnet_data0%7]
[/2607:fb90:543:e9dd:e03:fac6:8232:95d6%7%7]
I use some public IPv6 site and realized that my public IPv6 address is 2607:fb90:543:e9dd:e03:fac6:8232:95d6
. I would like to see if there is a reliable way to to extract 2607:fb90:543:e9dd:e03:fac6:8232:95d6%7%7
from the array since the index of the array changing all the time and from devices to devices.
I appreciate your help.