delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

Application's checking of connection #103

Closed Rokeder closed 8 years ago

Rokeder commented 8 years ago

Hello, everyone. I have the server, that sends me some data. I can access to it by loginWithEmail method and get a data by subscribing. And cause it is server, connection to it can be different, but without "no accessing" or "shutdown", so it works pretty good and 24/7. My problem is that: I have button in my Application and when i click on it, occurs connection check like: if(Login.mMeteor.isConnected()&& Login.mMeteor.isLoggedIn()){ alertSingleChoiceItems(); }else if(!(Login.mMeteor.isConnected()) || !(Login.mMeteor.isLoggedIn())){ toast = Toast.makeText(getApplicationContext(),"Connection is lost", Toast.LENGTH_SHORT); toast.show(); toast.setGravity(Gravity.CENTER, 0, 0); } I have thread that reconnect the user to server again(with login,subscribing). But after some time, diffent and random periods, after i walked around the town, i open my application with internet and see that i am not connected, cause i didn't get any data from server when i calling this method on the page(fragment): Login.mMeteor.call("GetCourierProfile", new ResultListener(){/*just gets a json file and show it/}

So, i push the button and PERMORMS the first condition. Yes, application thinks, that is connected to the server.

Is there special rule about "right reconnection"? This issue is very critical for my application.

ocram commented 8 years ago

Please don't open any more duplicates. We already have https://github.com/delight-im/Android-DDP/issues/50 and https://github.com/delight-im/Android-DDP/issues/57 and https://github.com/delight-im/Android-DDP/issues/59 and https://github.com/delight-im/Android-DDP/issues/79 so there's enough place to discuss your issues.

I'm afraid I don't know how to help. Maybe others can help. But please note that this is not a free support forum but an issue tracker. It has never been clear whether the issues describe are actually bugs in this library. As nobody else has reported such problems, I'm going to close these issues.

If you can't debug this and don't know where to find help elsewhere, maybe try another library that works better. Sorry!