<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[App + QAndroidService]]></title><description><![CDATA[<p dir="auto">Hi. My app has got an android service. The service is in a separate .so file. It uses a bluetooth device.<br />
Its main is:</p>
<pre><code>int main(int argc, char *argv[]) {
    QAndroidService app(argc, argv);
    new QCMainFormService();
    return app.exec();
}
</code></pre>
<p dir="auto">The app and the service works perfectly (they are in a different process).<br />
If I minimize the app, after a while, the service will be killed.<br />
This is the logcat output</p>
<pre><code>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

</code></pre>
<p dir="auto">How can I do in order to have my service working no stop?</p>
]]></description><link>https://forum.qt.io/topic/138236/app-qandroidservice</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 23:26:09 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/138236.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Jul 2022 15:04:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to App + QAndroidService on Fri, 29 Jul 2022 09:16:55 GMT]]></title><description><![CDATA[<p dir="auto">In order to keep the service running with the app in idle state it is necessary to use the method</p>
<pre><code>startForegroundService()
</code></pre>
<p dir="auto">The method require an implementation as it is explained in android developer documentations.</p>
]]></description><link>https://forum.qt.io/post/723179</link><guid isPermaLink="true">https://forum.qt.io/post/723179</guid><dc:creator><![CDATA[mrdebug]]></dc:creator><pubDate>Fri, 29 Jul 2022 09:16:55 GMT</pubDate></item></channel></rss>