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. App + QAndroidService
Forum Updated to NodeBB v4.3 + New Features

App + QAndroidService

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 408 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.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by
    #1

    Hi. My app has got an android service. The service is in a separate .so file. It uses a bluetooth device.
    Its main is:

    int main(int argc, char *argv[]) {
        QAndroidService app(argc, argv);
        new QCMainFormService();
        return app.exec();
    }
    

    The app and the service works perfectly (they are in a different process).
    If I minimize the app, after a while, the service will be killed.
    This is the logcat output

    07-28 17:00:15.546  5502  5520 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x25 in tid 5520 (QtThread), pid 5502 (lock:qt_service)
    07-28 17:00:15.569   389  3546 I ActivityManager: Process it.denisgottardello.LocalClock:qt_service (pid 5502) has died: fore SVC 
    07-28 17:00:15.566   389   389 I ActivityManager: type=1400 audit(0.0:205): avc: denied { getpgid } for scontext=u:r:system_server:s0 tcontext=u:r:crash_dump:s0:c512,c768 tclass=process permissive=1
    07-28 17:00:15.571   389   406 W system_server: kill(-5502, 9) failed: No such process
    
    

    How can I do in order to have my service working no stop?

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    1 Reply Last reply
    0
    • mrdebugM Offline
      mrdebugM Offline
      mrdebug
      wrote on last edited by
      #2

      In order to keep the service running with the app in idle state it is necessary to use the method

      startForegroundService()
      

      The method require an implementation as it is explained in android developer documentations.

      Need programmers to hire?
      www.labcsp.com
      www.denisgottardello.it
      GMT+1
      Skype: mrdebug

      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