Using Java code snippet in Qt Creator
-
Hi guys,
I know this is a weird question to ask .. but I am testing a tab for FTDI support... and I want to run this piece of code in Qt creator ( have been told not to use eclipse)
I have implemented jni , but I dont think I can run java functions using jni.
This is my code :
@
UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);// Find the first available driver.
UsbSerialDriver driver = UsbSerialProber.acquire(manager);if (driver != null) {
driver.open();
try {
driver.setBaudRate(115200);byte buffer[] = new byte[16]; int numBytesRead = driver.read(buffer, 1000); Log.d(TAG, "Read " + numBytesRead + " bytes.");
} catch (IOException e) {
// Deal with error.
} finally {
driver.close();
}
} @Can somebody please tell me how to get this code up and running in Qt creator ?