Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using Java code snippet in Qt Creator
Forum Updated to NodeBB v4.3 + New Features

Using Java code snippet in Qt Creator

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mansi
    wrote on last edited by
    #1

    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 ?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved