Firstly,
InetAddress[] getAllByName(java.lang.String)
[
^] does not do what you are asking. It returns the applicable IP addresses for the system identified by the supplied parameter; reading the javaDoc should help you.
Secondly, the list of all connected devices will be pretty large. Once you go beyond the local network, there's a larger one out there called the Internet and it has a lot of devices attached...