Getting SSID and other information of a wireless network in Java


I'm trying to get the SSID of my wireless network device in Java. I tried the official network tutorials <a href="http://java.sun.com/docs/books/tutorial/networking/nifs/retrieving.html" rel="nofollow">http://java.sun.com/docs/books/tutorial/networking/nifs/retrieving.html</a> but getDisplayName() getName() don't return SSID. Is there a way to get an exact SSID? Also, I'm also trying to read the wifi signal strength of all my network devices and couldn't find a way to do it. Can anyone please direct me from where to get all these information (tutorials, code samples etc)?



This cannot be done using pure Java. The Java API can take you as low as the <a href="http://docs.oracle.com/javase/6/docs/api/java/net/NetworkInterface.html" rel="nofollow">NetworkInterface</a> level in the networking stack, but not lower. When connected to a WiFi network, all SSID, handshaking and security stuff is done in lower levels than that - namely, your platform-dependent driver. The Java API (as of Java7) doesn't let you any closer to this information; you will have to use some platform-dependent code for that.


Did you see this <a href="http://sourceforge.net/projects/jwlanscan/" rel="nofollow">jWlanScan</a>


This is code sample where current connected wireless SSID is returned from cmd

ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", "netsh wlan show interfaces"); builder.redirectErrorStream(true); Process p = builder.start(); BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); String line; while (true) { line = r.readLine(); if (line.contains("SSID")){ // do something } }


  • WPF DataGridTextColumn Can't type point for float data
  • How to stub a method in ActiveSupport::TestCase
  • Spring form without commandName [duplicate]
  • Wobbly text on transform scale
  • Solr always use more than 90% of physical memory
  • docker + nginx + node.js + php-fpm
  • Left join on date range by group ID
  • Extracting a date from string
  • TYPO3 Database migration from fluidcontent to flux
  • Dynamic number of ChildViewControllers for XLPagerTabStrip
  • Git objects SHA-1 are file contents or file names?
  • javax.el.ExpressionFactory Error when running Spring Boot Application on Google App Engine Standard
  • Migrating MOSS 2007 from SQL 2000 to SQL 2005 [closed]
  • NHibernate add unmapped column in interceptor
  • Tableview make specific cell or row editable
  • Sprite animation wobbly / jumping in IE11
  • Running iPhone crash Logs from testers on XCode
  • Expression.Call GroupBy then Select and Count()?
  • Use awk to convert GPS Position to Latitude & Longitude
  • Protractor Page objects - TypeError: Object # has no method 'methodName'
  • Reload Page with Javascript after Database changes
  • How to run chrome.tabs.insertCSS from the background page on each page?
  • How to merge objects within array based on attribute
  • How to include associated objects using gon in Rails/jQuery
  • Unable to create Access token grant type in wso2 API manager store to test API
  • How can I ssh into a server that requires 2 password authentication using python's paramiko mod
  • Background transfer download task failed when app was closed
  • Make checkout phone field optional for specific countries in WooCommerce
  • calling IO Operations from thread in ruby c extension will cause ruby to hang
  • XEP-0166: Jingle protocol implementation for voice/video chat in iOS
  • Angular 4: Responsive Grid List
  • Cross compile glibc for arm, got undefined reference to some unwind functions
  • How do I use TagLib-Sharp to write custom (PRIV) ID3 frames?
  • Write to .csv file with PHP (Commas in Data Error)
  • CAS 4 - Not able to retrieve the LDAP groups after successful authentication
  • JavaScript RegExp Replace