What methods are available to resume an Android client connection when a network connection is lost or changed?
disconnectAndResubscribe() is a method available for handling detected network changes (when a connection is lost or changed). This is useful to force a new connection/connection reset when the network changes (in this case, via a Connectivity Event).
Connection resets may still occur on their own when switching from tower to tower, cellular to WiFi, etc., but in cases where it doesn't, or goes zombied for any other reason, this is a brute-force method of making it reconnect to PubNub.
Note: It is suggested that when implementing
disconnectAndResubscribe(), you experiment with the different types of network events Android broadcasts that may fire this logic, and add/remove from the logic as you please, in order to achieve the desired reconnection logic behavior.