compile 'com.facebook.network.connectionclass:connectionclass:1.0.1'
public interface ConnectionClassStateChangeListener { public void onBandwidthStateChange(ConnectionQuality bandwidthState); }
and subscribe with the listener:
ConnectionClassManager.getInstance().register(mListener);
Alternatively, you can manually query for the current connection quality bucket with getCurrentBandwidthQuality()
.
ConnectionQuality cq = ConnectionClassManager.getInstance().getCurrentBandwidthQuality();