When I am going to connect device through USB port, I want to detect it immediately. I am searching for a Java API, my main target is Linux OS.
Does anyone know an API like that?
When I am going to connect device through USB port, I want to detect it immediately. I am searching for a Java API, my main target is Linux OS.
Does anyone know an API like that?
You can do something like this:
try {
    String command = "lsusb"; // you may add some param if you want
                              // or use adb for instance
    Process child = Runtime.getRuntime().exec(command);
    // Get output stream to write from it
    OutputStream out = child.getOutputStream();
    // TODO parsing lsusb output
    out.close();
} catch (IOException e) {
}