Real time disconnecting from service

Hello,

I’m trying to work with real time on android but I keep getting “V/FA: Inactivity, disconnecting from the service”
this is my code:
EventHandler<BackendlessUser> userEventHandler = Backendless.Data.of(BackendlessUser.class).rt();
userEventHandler.addUpdateListener(new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser response) {
if(!response.getProperty(“filename”).toString().isEmpty()){
url = response.getProperty(“filename”).toString();
Log.e(“URL–>”,url);
}
}

@Override
public void handleFault(BackendlessFault fault) {
Log.e(“ErrorUpdate–>”,fault.getMessage());
}
});

Hello.
I’ve created inner task to investigate the problem further.
[BKNDLSS-18047]

Are you still experiencing this problem?
I tried with my app and your code example, all works fine.
By the way, i would recommend to check if the response.getProperty(“filename”) returns not null.

Changed to not null, still the same problem
adding a screen shot

I’m talking not about response.getProperty("filename").toString() but about response.getProperty("filename")

And i also would recommend to remove all code inside handleResponse() and put there only one logging command, just to check whether the handler is invoked.

one logging command?
You mean log in to Backendless?

No, i mean just logcat.

Same.

if you put breakpoint on line 36, will it work?

The breakpoint didn’t do anything, but I figured something, the app response when I change something directly in the data base but not when I update through code from other device

Ok, we’ll check this behaviour.

I’ve tried with two devices. One of them was changing records in Users table, and another one listening to the changes in the same table. And all notifications were coming successfully.
Have you any other logic in your project that may influence on network work or maybe you have some other backendless api calls the app ?
Try to create totally clear app without any logic except one simple RT listener. Post here about your results, please.

I created a new app, tried a simple RT listener and still nothing,
I’m obviously doing something wrong I just don’t know what, I’m uploading the sample project so you can see
what is wrong
https://www.dropbox.com/s/hkpm849i5xczyls/RTTesting.zip?dl=0

Hi.
I found a problem in your sample: TestActivity class, line 66.
Backendless.UserService.update

Try to use:
Backendless.Data.of(BackendlessUser.class).save
since you subscribe to listen to changes in Data service:
Backendless.Data.of(BackendlessUser.class).rt().addUpdateListener

Also pay attention to build.gradle. It looks a little bit strange, because of nested dependencies sections.

1 Like