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. Running A Profiled App on X86_64 Android Emulator Qt6.9.1
Forum Updated to NodeBB v4.3 + New Features

Running A Profiled App on X86_64 Android Emulator Qt6.9.1

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
15 Posts 4 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #5

    Hi,

    Are you sure you are closing your application and not just putting it in the background ? Just leaving it to return to the shell (the name is confusing as most people associate shell with a terminal running bash, zsh, etc.) does not equal stopping it.
    Also

    return ret;
    

    would be the expect way to end your application.

    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
    • SMF-QtS Offline
      SMF-QtS Offline
      SMF-Qt
      wrote on last edited by
      #6

      Yes I was using "return ret;" How would you suggest I close my App?
      Thanks

      JonBJ 1 Reply Last reply
      0
      • SMF-QtS SMF-Qt

        Yes I was using "return ret;" How would you suggest I close my App?
        Thanks

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #7

        @SMF-Qt
        But your code shows you using exit(ret);. @SGaist is suggesting you try replacing it with return ret; (assuming what you showed is in your main()) in case that makes any difference. Have you tried that?

        You might put some qDebug() or whatever is appropriate immediately above that just to make sure whether your app really is exiting the exec() loop.

        SMF-QtS 1 Reply Last reply
        0
        • JonBJ JonB

          @SMF-Qt
          But your code shows you using exit(ret);. @SGaist is suggesting you try replacing it with return ret; (assuming what you showed is in your main()) in case that makes any difference. Have you tried that?

          You might put some qDebug() or whatever is appropriate immediately above that just to make sure whether your app really is exiting the exec() loop.

          SMF-QtS Offline
          SMF-QtS Offline
          SMF-Qt
          wrote on last edited by SMF-Qt
          #8

          @JonB

          I started with that and it is back in the current main.cpp. The behavior is the same.
          The debug version on the X86_64 simulator goes throught this code so I assume the arm64-v8a version on my phones and tablet does too.

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

            As I wrote before, just returning to the shell does not mean your application is closed.
            You have to explicitly close it.

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

            SMF-QtS 1 Reply Last reply
            0
            • SGaistS SGaist

              As I wrote before, just returning to the shell does not mean your application is closed.
              You have to explicitly close it.

              SMF-QtS Offline
              SMF-QtS Offline
              SMF-Qt
              wrote on last edited by
              #10

              @SGaist

              Thanks but I don't know how that is done on Android.

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

                AFAIR, if you swipe from the bottom up, it should show you all the applications that are running and you can there stop them.

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

                SMF-QtS 1 Reply Last reply
                0
                • SGaistS SGaist

                  AFAIR, if you swipe from the bottom up, it should show you all the applications that are running and you can there stop them.

                  SMF-QtS Offline
                  SMF-QtS Offline
                  SMF-Qt
                  wrote on last edited by
                  #12

                  @SGaist

                  Yes I know that but I was looking for a programatic way.

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

                    Depending on what you have in mind, a QTimer calling the application quit slot might do what you want.

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

                    SMF-QtS 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Depending on what you have in mind, a QTimer calling the application quit slot might do what you want.

                      SMF-QtS Offline
                      SMF-QtS Offline
                      SMF-Qt
                      wrote on last edited by SMF-Qt
                      #14

                      @SGaist

                      Thanks but I have a quit button on my app which calls QWidget::close on the top level widget which shuts down my application apart from the database which is handled by main.
                      I have set app->setQuitOnLastWindowClosed(true); and app->exec() is returning 0 so everything is shutdown. once app->exec() returns the database is closed and the app destructors are run via the delete app at the very end of main. I am confident having debugged the emulated version of my app that my code is shutting everything down and exiting with a return value of 0.

                      SMF-QtS 1 Reply Last reply
                      0
                      • SMF-QtS SMF-Qt

                        @SGaist

                        Thanks but I have a quit button on my app which calls QWidget::close on the top level widget which shuts down my application apart from the database which is handled by main.
                        I have set app->setQuitOnLastWindowClosed(true); and app->exec() is returning 0 so everything is shutdown. once app->exec() returns the database is closed and the app destructors are run via the delete app at the very end of main. I am confident having debugged the emulated version of my app that my code is shutting everything down and exiting with a return value of 0.

                        SMF-QtS Offline
                        SMF-QtS Offline
                        SMF-Qt
                        wrote on last edited by SMF-Qt
                        #15

                        @SMF-Qt
                        I have noticed that after I click the Quit button and my application has exited main I sometimes get the following abort message from the QtCreator debugger:

                        W/qtMainLoopThrea: type=1400 audit(0.0:64483): avc: denied { read } for name="/" dev="tmpfs" ino=1 scontext=u:r:untrusted_app:s0:c209,c256,c512,c768 tcontext=u:object_r:device:s0 tclass=dir permissive=0 app=com.home.QtTest4
                        W/qtMainLoopThrea: type=1400 audit(0.0:64484): avc: denied { read } for name="devices" dev="sysfs" ino=4521 scontext=u:r:untrusted_app:s0:c209,c256,c512,c768 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0 app=com.home.QtTest4
                        D/EGL_emulation: app_time_stats: avg=171.19ms min=6.22ms max=947.76ms count=6
                        I/ImeTracker: com.home.QtTest4:89e0e728: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT fromUser false
                        I/ImeTracker: com.home.QtTest4:c4e121a7: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT fromUser false
                        D/EGL_emulation: app_time_stats: avg=2462.04ms min=33.03ms max=10232.86ms count=5
                        I/default : main() returned 0
                        D/VRI[QtActivity]: visibilityChanged oldVisibility=true newVisibility=false
                        W/default : java.lang.NullPointerException: Attempt to invoke virtual method 'void android.content.Context.unregisterReceiver(android.content.BroadcastReceiver)' on a null object reference
                        W/default : at org.qtproject.qt.android.network.QtNetwork.unregisterReceiver(QtNetwork.java:49)
                        W/default : at org.qtproject.qt.android.QtNative.startQtApplication(Native Method)
                        W/default : at org.qtproject.qt.android.QtNative$$ExternalSyntheticLambda4.run(D8$$SyntheticClass:0)
                        W/default : at org.qtproject.qt.android.QtThread$1.run(QtThread.java:25)
                        W/default : at java.lang.Thread.run(Thread.java:1012)
                        W/default :
                        F/libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x749993a02ab8)
                        F/libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x749993a02ab8)
                        F/libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20289 (hwuiTask0), pid 20225 (.home.QtTest4)
                        09:24:14: Android target "com.home.QtTest4" died.

                        1 Reply Last reply
                        0
                        • SMF-QtS SMF-Qt referenced this topic on

                        • Login

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