Android Notification and Service with Qt

1,642 views
Skip to first unread message

dagvegar

unread,
Apr 17, 2013, 8:54:17 AM4/17/13
to andro...@googlegroups.com
Hello,

Among many other users I see in this group, I want to push out notifications to the user from my application.

I also would like to prevent Android to kill my application even if it consumes quite a bit of RAM / CPU.

So I have combined an Android service test app (FakePlayer) and made a test application to acheive this with Qt.

Thus, I have just made an ServiceTest-app from scratch in Necessitas 4.1, and edited QtActivity.java and the AndroidManifest.xml, and added a new file called ServiceTest.java.

When running the test on a device, in my case a Samsung Note II, the app shows correctly and the notification appears correctly. 

Now, if pressing the phones home button, the app hides and you may press the notification to get back to the app, which is fine.

But: (after first doing the line above) if you press home and press the ServiceTest icon from the program menu, then only the label of the app shows which is NOT okay.

I guess some layout reference between Android and Qt is missing here, but I am not sure.

Can anyone help me out here?

All files attached, try it out! Alternatively send me a working example or link to it.

Best regards,

Dag Vegar Tveitå
ServiceTest.zip

Dag Vegar

unread,
Apr 18, 2013, 8:56:39 AM4/18/13
to andro...@googlegroups.com
It seems like this issue is all about the "black screen" pointed out earlier, where the solution was to set android:launchMode="singleInstance" in the manifest.


So for now this issue is solved.

Paul-Henri FERME

unread,
Apr 11, 2014, 12:26:26 PM4/11/14
to andro...@googlegroups.com
To all.
I tried to compile and run the attached example but get  an error   message from ant when preparing the apk package..
Obviuosly this was written for necessitas and and i am trying to build it using Qt 5.2 which support natively the andoid platform.
Does anybody succeed running  this under  QT5.2 ?

Please not my SDK/compile environement is working ok on standard examples using linux.
I just have a specific problem with this template.... 

PHF


Reply all
Reply to author
Forward
0 new messages