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. Sending data through usb connection?
Forum Update on Monday, May 27th 2025

Sending data through usb connection?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 5 Posters 1.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.
  • H Offline
    H Offline
    HaoXiang
    wrote on last edited by
    #1

    I am new to Qt. Is there any way to create an app which sends strings of data from desktop to android through usb connection? The desktop acts as a server and the android acts as a client. I am using Qt 5.12.1. Thanks in advance.

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

      Hi,

      Do you mean something like the fortune client and server examples ?

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

      H 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

        Do you mean something like the fortune client and server examples ?

        H Offline
        H Offline
        HaoXiang
        wrote on last edited by
        #3

        @SGaist No, I just mean that the desktop will send data to the android device through serial port connection, just like a server will send data to the client. Is there any way to do it in Qt?

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

          What exactly do you want to achieve with these strings ?

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

          H 1 Reply Last reply
          0
          • SGaistS SGaist

            What exactly do you want to achieve with these strings ?

            H Offline
            H Offline
            HaoXiang
            wrote on last edited by
            #5

            @SGaist Just need to display these data on the android device. I already have bluetooth option set up but I would like another option(serial port connection) set up too.

            raven-worxR 1 Reply Last reply
            0
            • H HaoXiang

              @SGaist Just need to display these data on the android device. I already have bluetooth option set up but I would like another option(serial port connection) set up too.

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @HaoXiang
              IIRC Android doen't allow to open serial ports, at least not without root access

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              H 1 Reply Last reply
              1
              • raven-worxR raven-worx

                @HaoXiang
                IIRC Android doen't allow to open serial ports, at least not without root access

                H Offline
                H Offline
                HaoXiang
                wrote on last edited by
                #7

                @raven-worxI I was thinking using usb port for android and serial port for desktop because I am using a usb cable to send data.
                Is there any other way to send data using a usb cable?

                aha_1980A J.HilkJ 2 Replies Last reply
                0
                • H HaoXiang

                  @raven-worxI I was thinking using usb port for android and serial port for desktop because I am using a usb cable to send data.
                  Is there any other way to send data using a usb cable?

                  aha_1980A Offline
                  aha_1980A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @HaoXiang if you can set up a network connection over USB, then all network protocols are possible.

                  Regards

                  Qt has to stay free or it will die.

                  1 Reply Last reply
                  2
                  • H HaoXiang

                    @raven-worxI I was thinking using usb port for android and serial port for desktop because I am using a usb cable to send data.
                    Is there any other way to send data using a usb cable?

                    J.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on last edited by J.Hilk
                    #9

                    @HaoXiang I don't think it is possible out of the box, usually, phones are very restricted on what they allow to transfer between pc and phone via USB.

                    For obvious security reasons. If your root your phone(on android) than yes that should be possible.
                    Should, but I personally wouldn't know how

                    If you're simply looking for an alternative to bluetooth, why not use WLAN and TCP/UDP sockets?


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

                    1 Reply Last reply
                    2

                    • Login

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