facebookarchive / network-connection-class

Listen to current network traffic in the app and categorize the quality of the network.
Other
3.18k stars 515 forks source link

Cutomization of bandwidth #8

Closed vivekgidmare closed 9 years ago

vivekgidmare commented 9 years ago

Can we have way to customize bandwidth range instead of fixed? So developer can customize it like for poor under 50Kbps depends on their need.

rrong commented 9 years ago

The values for the bandwidth ranges are in ConnectionClassManager.java: https://github.com/facebook/network-connection-class/blob/master/connectionclass/src/main/java/com/facebook/network/connectionclass/ConnectionClassManager.java#L37

You can change DEFAULT_POOR_BANDWIDTH to 50 for your example to customise your bandwidth ranges.

SeyelentEco commented 9 years ago

I agree with @rrong, these values were hardcoded because they were based on a lot of data and analysis. You can change them locally for your setting if you want but we want a consistent value for most people so we can easily compare data.