public ArrayList<String> getBroadcastAddr() {

        ArrayList<String> listOfBroadcasts = new ArrayList<String>();
        try {
            Enumeration<NetworkInterface> dev = NetworkInterface.getNetworkInterfaces();
            while (dev.hasMoreElements()) {
                NetworkInterface ni = dev.nextElement();
                if (ni.isLoopback()) {
                    continue;
                }
                Iterator<InterfaceAddress> addr = ni.getInterfaceAddresses().iterator();

                while (addr.hasNext()) {

                    InterfaceAddress iaddr = (InterfaceAddress) addr.next();
                    if (iaddr == null) {
                        continue;
                    }
                    InetAddress broadcast = iaddr.getBroadcast();
                    if (broadcast != null) {
                        System.out.println("Found broadcast: " + broadcast);
                        listOfBroadcasts.add(broadcast.toString().replace("/", ""));
                    }

                }
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        if (listOfBroadcasts.size() < 1) {
            return null;
        } else {
            return listOfBroadcasts;
        }

    }