Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Sending data through usb connection?

    General and Desktop
    5
    9
    857
    Loading More Posts
    • 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
      HaoXiang last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 2
        • H
          HaoXiang @SGaist last edited by

          @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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • H
              HaoXiang @SGaist last edited by

              @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-worx 1 Reply Last reply Reply Quote 0
              • raven-worx
                raven-worx Moderators @HaoXiang last edited by

                @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 Reply Quote 1
                • H
                  HaoXiang @raven-worx last edited by

                  @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_1980 J.Hilk 2 Replies Last reply Reply Quote 0
                  • aha_1980
                    aha_1980 Lifetime Qt Champion @HaoXiang last edited by

                    @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 Reply Quote 2
                    • J.Hilk
                      J.Hilk Moderators @HaoXiang last edited by J.Hilk

                      @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

                      Qt Needs YOUR vote: https://bugreports.qt.io/browse/QTQAINFRA-4121


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

                      1 Reply Last reply Reply Quote 2
                      • First post
                        Last post