Hi I 'm trying to discover network without using a listener this the code but it doesn't give any think

import com.digi.xbee.api.XBeeDevice;
import com.digi.xbee.api.XBeeNetwork;
import com.digi.xbee.api.exceptions.XBeeException;
import java.util.ArrayList;
import java.util.List;
import com.digi.xbee.api.RemoteXBeeDevice;
public class discover {

private static final String PORT = "COM5";
// TODO Replace with the baud rate of your module.
private static final int BAUD_RATE = 9600;
public static void main(String[] args) {
	System.out.println(" +-------------------------------------------+");
	System.out.println(" | XBee Java Library Discover Devices Sample |");
	System.out.println(" +-------------------------------------------+

");

	XBeeDevice myDevice = new XBeeDevice(PORT, BAUD_RATE);
	try {
		myDevice.open();
		XBeeNetwork myXBeeNetwork = myDevice.getNetwork();
		myXBeeNetwork.setDiscoveryTimeout(15000);
		myXBeeNetwork.startDiscoveryProcess();
		List devices = new ArrayList();
		
        
 
		for(int i = 0 ; i < devices.size(); i++){
		RemoteXBeeDevice xbee = new RemoteXBeeDevice(myDevice,devices.get(i).get64BitAddress());
		System.out.println(devices.get(i).get64BitAddress().toString());
		System.out.println(devices.get(i).getPANID().toString().getBytes());
		System.out.println(devices.get(i).getXBeeProtocol());
		}
				
			
		
	} catch (XBeeException e) {
		e.printStackTrace();
		myDevice.close();
		System.exit(1);
	}

}
}
Note I’m using XBee S2 and thisis my configuration :
for the zigbee coordinator api:
-PAN ID: C001BEE
-SC scan channels:FFF
-DH:0
-DL:FFFF
-AP API enable:1
for the zigbee routerapi:
-PAN ID: C001BEE
-SC scan channels:FFF
-JV channel verification: enabled
-DH:0
-DL:0
-AP API enable:1

What do you mean by Any Listener? If you want to know when a node joins the network, you must read the COM port for data. Otherwise it makes no sense to issue a Node Discovery or enabling the JV command if your application is not going to listen for the data.