Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QSerialPort support Android
Forum Update on Monday, May 27th 2025

QSerialPort support Android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
qserialportandroid
5 Posts 3 Posters 2.4k Views
  • 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.
  • G Offline
    G Offline
    GoranShekerov
    wrote on last edited by
    #1

    The documentation for Qt 5.6 says that Qt for Android does not support QSerialPort. I'm using USB to RS232 convertor with OTG used on the android tablet. If Anyone knows when to expect the QSerialPort support on Android? or anyone suggest some workaround?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That's a question best asked on the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kuzulis
        Qt Champions 2020
        wrote on last edited by
        #3

        If Anyone knows when to expect the QSerialPort support on Android?

        In the near future it it isn't planned. I, as maintainer, have no resources as for time, as for stimulus, and as for existence of appropriate stuff (because there are a lot of USB/Serial chips with own I/O protocols).

        So, say, "THANKS", for the Google, that the Android has not an Java classess with access to the serial ports. :)

        By the way:

        1. There are some patch-set which are "implements" the OTG support for some USB/Serial converters,which nobody are tested: https://codereview.qt-project.org/#/c/84338/ .

        2. If your device is rooted, then you can use QSerialPort similar to linux way (but, with the root privileges), which also are not tested.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          GoranShekerov
          wrote on last edited by
          #4

          Thank you very much kuzulis for the informattions. I'll try your suggestions, as usual I'll write back. I found a suggestion on the net to use bluetooth to rs232 converter, but for now I consider it as less robust, more expensive and more unsecured solution. Thanks again.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GoranShekerov
            wrote on last edited by
            #5

            Just to confirm that QSerialPort can be used on rooted Android. (Some info)

            Notes:

                #ifdef Q_OS_ANDROID
                    /* This will open the Superuser app,
                     * prompting for root permisions
                     */
                    QProcess proc(&a);
                    proc.start("su -c \"chmod 666 /dev/ttyUSB0\"");
                #endif
            
            • Don't forget to disable SELinux on Android 4.2 and above :)
            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