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. Service not started
Forum Updated to NodeBB v4.3 + New Features

Service not started

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 3 Posters 2.0k Views 3 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.
  • V Offline
    V Offline
    vlada
    wrote on last edited by
    #1

    Hi,

    I have followed the guide here and added a service to my project. The app compiles and runs without any problems but it seems I can not start the service.

    I have a debug message in the main loop to see if it has started. But nothing is printed in the debug window after trying to start the service, neither the message nor an error.

    What might be wrong? How can I debug this situation? I checked all the names and entries a couple times if they match and it all seems to be correct. What should I check further? Thank you.

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

      Hi,

      What service are you talking about ?
      On what platform ?
      With which version of Qt ?

      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
      • V vlada

        Hi,

        I have followed the guide here and added a service to my project. The app compiles and runs without any problems but it seems I can not start the service.

        I have a debug message in the main loop to see if it has started. But nothing is printed in the debug window after trying to start the service, neither the message nor an error.

        What might be wrong? How can I debug this situation? I checked all the names and entries a couple times if they match and it all seems to be correct. What should I check further? Thank you.

        A Offline
        A Offline
        ambershark
        wrote on last edited by
        #3

        @vlada Are you sure it's not starting? Android may be running the service but there may be a permission or some other issue with the debug statement.

        Can you check the process list on your android device and see if it is running?

        As for debugging check the syslog after trying to start it and see if there are any issues there.

        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vlada
          wrote on last edited by
          #4

          @SGaist I'm talking about Android service, as described in the guide by Bogdan Vatra I mentioned.

          @ambershark I was trying to check if the process is running but I couldn't find any application which would show it. I couldn't find an Android app similar to Process Explorer in Windows. How do I check the syslog? Thank you and I'm sorry for these trivial questions, I'm really not familiar with debugging something on Android.

          A 1 Reply Last reply
          0
          • V vlada

            @SGaist I'm talking about Android service, as described in the guide by Bogdan Vatra I mentioned.

            @ambershark I was trying to check if the process is running but I couldn't find any application which would show it. I couldn't find an Android app similar to Process Explorer in Windows. How do I check the syslog? Thank you and I'm sorry for these trivial questions, I'm really not familiar with debugging something on Android.

            A Offline
            A Offline
            ambershark
            wrote on last edited by
            #5

            @vlada Well first off connect to your device with adb.. then you can run standard linux commands (mostly). Like so:

            $ adb shell
            ... should now be connected to your device
            
            Now you can check processes with ps:
            $ ps -p
            (in linux I use ps -elf) not sure what ps -p will do in android, check ps --help for more info
            
            You can then also check your logs with:
            $ logcat
            

            Here's more info on the logcat command:
            http://adbshell.com/commands/adb-logcat

            My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

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

              Had a highlighting glitch which made me miss the link.

              But again, which version of Qt are you using ?
              And what Android version is giving you trouble ?

              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
              • V Offline
                V Offline
                vlada
                wrote on last edited by vlada
                #7

                @SGaist I'm using the latest version of Qt 5.9 and QtCreator 4.4 with various Android versions (mostly Marshmallow). But the problem was caused by a fault in my code.

                @ambershark Thanks for those tips. It helped me to identify that the service is really not running.

                I used the whole service part from the demo program and made it to work after a lot of attempts. Now I'm slowly changing the code to adopt it to my needs while checking that the service is still running.

                What makes it difficult is the fact that there are only very few useful messages telling me what's wrong. I also realized that if I use qDebug() in the service, the output won't appear in the console window. That is strange.

                This problem was described in this bug report. It should have been fixed since QtCreator 4.3.1 but it still doesn't work in my 4.4.

                Anyway now it works and I will have to find out how to create a service from a class. At least it is running now so I can work on it. Thank you for your help.

                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