Android-DDP icon indicating copy to clipboard operation
Android-DDP copied to clipboard

Improve attempts to re-connect by listening for connectivity changes

Open ocram opened this issue 9 years ago • 1 comments

When the device loses its internet connection, we do currently queue the messages that cannot be send. The library will then try to re-connect several times. If it fails every time, the library will just stop trying and disconnect. If connection can be re-established, the queued messages are dispatched.

We could enhance the process of trying to re-connect by listening for connectivity changes. This could be more efficient. The required permission <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> will not always be there, but when it is, we can use a broadcast receiver for <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />.

ocram avatar May 18 '16 23:05 ocram

I'll to do it my self. Hope it works 👍

My fast solution it's to aim the broadcast with the singletonMeteor to control this event. Let me implement it.

rakirox avatar May 19 '16 15:05 rakirox