Android Question B4A Receivers with MQTT in background

Hi,
I am working on a project where i am using MQTT with B4xpages and drawer.
I am unable to understand how to keep app running in background and pop up notification or call sub when data receives on one or more subscribed topic.
I did the same earlier with services but now totally confused with start service at or receivers etc
Request to help out to overcome problem.

Additionally i wish to add new project template with following in addition to B4xpages
1. B4xPages with drawer
2. B4xpages with background services
3. B4xpages with background services with MQTT

Since most of the users mainly IOT based users are working with above scenario so i think better to have such project template in upcoming version of B4A

Regards,

Ulhas Rane
 
Thanks Erel, You are always there to give reponce.

I have gone through the example, it has sticky notification and can not be canceled if user want to.

Is there any way i can this behaviour so that notification will not be shows alway in notification window and user can cancel it

Regards
 
Upvote 0
Thanks Erel, You are always there to give reponce.

I have gone through the example, it has sticky notification and can not be canceled if user want to.

Is there any way i can this behaviour so that notification will not be shows alway in notification window and user can cancel it

Regards
Update,
I have gone thru the example and managed to get notification but that with not nb6 and csbuilder.

Alao i am getting notification only if i dont close the notifications which i received after starting the app and then closed without cancellation of existing notification

Is there any method exists to resolve the issue ie. I should get notification even though the notifications are not kept on in status bar or notification panel
 
Upvote 0

Tareq Khan

Member
Licensed User
Longtime User
Update,
I have gone thru the example and managed to get notification but that with not nb6 and csbuilder.

Alao i am getting notification only if i dont close the notifications which i received after starting the app and then closed without cancellation of existing notification

Is there any method exists to resolve the issue ie. I should get notification even though the notifications are not kept on in status bar or notification panel
Hi, were anyone able to use B4XPages with MQTT, where the MQTT service always runs even after a boot? I wrote my code in the similar style of Background location tracking, but used B4XPages. In that case, the MQTT Service turns on for few seconds after the boot and then it is killed automatically. It works if I use the classic B4A acitivity. Is it not possible to use foreground service with a partial wake lock with B4XPages? Thanks.
 
Upvote 0
Top