Print Page | Close Window

doesn't work in TAndroidService

Printed From: TMS Software
Category: Developer Tools
Forum Name: DEV MQTT
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=7882
Printed Date: 27 Jun 2019 at 2:01pm


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

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?





Replies:
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
Hi,
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.



Print Page | Close Window