Print Page | Close Window

doesn't work in TAndroidService

Printed From: TMS Software
Category: Developer Tools
Forum Name: DEV MQTT
Forum Discription:
Printed Date: 27 May 2020 at 1:11pm

Topic: doesn't work in TAndroidService
Posted By: Murat Gulerer
Subject: doesn't work in TAndroidService
Date Posted: 30 May 2017 at 3:58pm

I downloaded TMSMQTT for Delphi 10.2 Tokyo, installed the bpl,  made a demo application that works on win32 and android, had some fun chatting with the boss. All is well up to that point.

Then I made an android service and tried the same thing. ConnectedStatusChanged is called, but it says "csReconnecting". Then it never enters the callback again. 

I see that the service is still alive inside adb logcat, but no further TMSMQTT callbacks are fired. 

Do I need a UI event loop for TMSMQTT component to work ? Can we use it inside a TAndroidService?

Posted By: Gulerer Murat
Date Posted: 07 Nov 2017 at 1:57pm
Can I get information about this message?

Posted By: Bruno Fierens
Date Posted: 07 Nov 2017 at 5:17pm

We have not validated this component against the usage from an Android service.

At this time, it is unsure whether we can support this and we'll need to investigate this as soon as we can allocate time for it.

Posted By: Gulerer Murat
Date Posted: 10 Nov 2017 at 1:24pm
We need to be able to call MQTT from the Android service, how else can I set up my own notification mechanism?

Posted By: Bruno Fierens
Date Posted: 11 Nov 2017 at 9:43am
As informed, we have at this point not done this validation nor investigation yet, so at this point we cannot answer this question. At this moment, we support the component for use in applications only till we could allocate time to do the necessary validations for use in a service.

Posted By: Gordon Hamm
Date Posted: 02 Dec 2017 at 4:26am
Hi, I am using this with Firemoney.. It seems to work fine with IOS unless it goes to sleep for a long time.. If it goes to background for a short period, I can reconnect just fine when IOS goes to foreground. If its background for a long time and I try to reconnect, I never can get a connection event.
Now, reading this, I thinking this might not work with Android.. I need to be able to have my app run in both IOS and android

what are the plans? I love the components for the most part, but thinking they are imature for firemonkey

Posted By: Bruno Fierens
Date Posted: 08 Dec 2017 at 8:01pm
As explained, for v1.0 we focused on use from applications, not services.
As soon as time permits, we'll set the scope for development of the next version.

Posted By: Gordon Hamm
Date Posted: 15 Dec 2017 at 7:57pm
Actually, Ive got most everything working fine.. but when the app goes into the back ground, I disconnect. `(as IOS is going to put it to sleep anyway) then reconnect when It comes back to foreground. I works most of the time, but sometimes, The connect method just gets stuck. If you restart the app, everything is perfect. I wish these components were more popular to get more attention.. They are so valuable when you understand what they can do.

Posted By: Rossi Marco
Date Posted: 13 Oct 2018 at 2:53pm
any news on making it work (without disconnect) in Android Service ?

Posted By: Bruno Fierens
Date Posted: 15 Oct 2018 at 12:28pm
Due to very high workload on other projects, we could unfortunately not yet handle this.

Date Posted: 06 Apr 2020 at 2:59am
Is there any improvement  for Android Service?

Posted By: Bruno Fierens
Date Posted: 06 Apr 2020 at 10:44am
Sorry, given little demand for this specific feature and high workload overall, we have not been able to handle this so far.

Print Page | Close Window