Use java to find SSID of wireless network

We are writing a project in Java (compiled for JRE 1.6) and need some help

After browsing this website, we have learned more about Google and Java documents After reading the code: http://download.oracle.com/javase/tutorial/networking/nifs/retrieving.html

It looks like we're getting closer, but it's killing us. All the interfaces seem to be connected to "net0" through "net13" (on my laptop) We can't get SSID from any interface I do realize that the code in the example only gives the interface name, not the connected network, but it doesn't seem to provide a way to obtain the connected network information

Any help, it will be very useful!

Greetings to Martin, New Jersey

Solution

You cannot access the low-level details of this network using Java You can use the networkinterface class to obtain some details of the network interface, but if you view it in the provided way, no one is related to the WiFi network, and no way is provided to obtain the SSID As shown below, you should use some native functions by calling the native library using JNI or by calling the OS tool using runtime

Java is not designed to do such things. It is difficult to implement it in a platform independent manner. Any hardware level details cannot be managed by Java principles

The same applies to other networks, such as 3G, GPRS... Applications should not know the connection type and its details Java can only manage things at the transport (TCP) level, not the network (IP), not the link (3G, WiFi, Ethernet...), so you can only manage sockets

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>