Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to execute .hex file on the other device using QT Application
QtWS25 Last Chance

How to execute .hex file on the other device using QT Application

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 4 Posters 721 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.
  • K Offline
    K Offline
    kabdul
    wrote on last edited by
    #1

    Hi,

    I am new to QT. I have created a sample application for selecting the .hex file through FileDialog and I need to execute the selected .hex file on my device. For that I have used the QProcess::startDetached but the file is not executed. Can you please let me know how to execute this file on my android device. Below is the Code which I have tried.

    QFileDialog dialog(this);
    dialog.setFileMode(QFileDialog::AnyFile);
    dialog.setNameFilter(tr("Hex Files (*.hex)"));
    dialog.setViewMode(QFileDialog::Detail);
    QStringList fileNames;
    if (dialog.exec())
    {
    fileNames = dialog.selectedFiles();

        //QString program("cmd /k cd " + fileNames[0]);
        //bool chk=QProcess::startDetached(program);
    
        QProcess::startDetached(fileNames[0]);
        if(chk==true)
        {
        QMessageBox::information(this,"Information","File is Executed");
        }
        else
        {
            QMessageBox::information(this,"Information","File is Not Executed");
        }
    }
    
    JonBJ 1 Reply Last reply
    0
    • K kabdul

      Hi,

      I am new to QT. I have created a sample application for selecting the .hex file through FileDialog and I need to execute the selected .hex file on my device. For that I have used the QProcess::startDetached but the file is not executed. Can you please let me know how to execute this file on my android device. Below is the Code which I have tried.

      QFileDialog dialog(this);
      dialog.setFileMode(QFileDialog::AnyFile);
      dialog.setNameFilter(tr("Hex Files (*.hex)"));
      dialog.setViewMode(QFileDialog::Detail);
      QStringList fileNames;
      if (dialog.exec())
      {
      fileNames = dialog.selectedFiles();

          //QString program("cmd /k cd " + fileNames[0]);
          //bool chk=QProcess::startDetached(program);
      
          QProcess::startDetached(fileNames[0]);
          if(chk==true)
          {
          QMessageBox::information(this,"Information","File is Executed");
          }
          else
          {
              QMessageBox::information(this,"Information","File is Not Executed");
          }
      }
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @kabdul

      How to execute .hex file on the other device using QT Application

      In what way is a file ending in .hex executable under Android?

      What do you mean about "executing something on the other device"? What two devices are involved, and where are you trying to execute what "on the other device"?

      K 2 Replies Last reply
      1
      • JonBJ JonB

        @kabdul

        How to execute .hex file on the other device using QT Application

        In what way is a file ending in .hex executable under Android?

        What do you mean about "executing something on the other device"? What two devices are involved, and where are you trying to execute what "on the other device"?

        K Offline
        K Offline
        kabdul
        wrote on last edited by
        #3

        @JonB said in How to execute .hex file on the other device using QT Application:

        ething on the other dev

        Hi,

        Yes I need to execute it in the android device its an embedded device which is running android 8.1.

        Thanks in Advance

        1 Reply Last reply
        0
        • JonBJ JonB

          @kabdul

          How to execute .hex file on the other device using QT Application

          In what way is a file ending in .hex executable under Android?

          What do you mean about "executing something on the other device"? What two devices are involved, and where are you trying to execute what "on the other device"?

          K Offline
          K Offline
          kabdul
          wrote on last edited by
          #4

          @JonB I am creating it as a apk file and I am running the application in that device.

          jsulmJ 1 Reply Last reply
          0
          • K kabdul

            @JonB I am creating it as a apk file and I am running the application in that device.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @kabdul And what is this .hex?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            K 1 Reply Last reply
            0
            • jsulmJ jsulm

              @kabdul And what is this .hex?

              K Offline
              K Offline
              kabdul
              wrote on last edited by
              #6

              @jsulm I don't know about that we are just testing the application how it works. I got a task like I need to execute the hex file on the android device.

              jsulmJ 1 Reply Last reply
              0
              • K kabdul

                @jsulm I don't know about that we are just testing the application how it works. I got a task like I need to execute the hex file on the android device.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @kabdul If you don't know what this hex file is and whether it is a valid Android executable, why don't you create a small console app for android and try to start that one?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                K 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @kabdul If you don't know what this hex file is and whether it is a valid Android executable, why don't you create a small console app for android and try to start that one?

                  K Offline
                  K Offline
                  kabdul
                  wrote on last edited by
                  #8

                  @jsulm said in How to execute .hex file on the other device using QT Application:

                  @kabdul If you don't know what this hex file is and whether it is a valid Android executable, why don't you create a small console app for android and try to start that one?

                  How to do that one? can you please give me any sample code.

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    Jadi Nabil
                    wrote on last edited by
                    #9

                    i have the same problem

                    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