Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

ConnectionQuality is always unknown #22

Open
Dgotlieb opened this issue Jun 13, 2016 · 8 comments
Open

ConnectionQuality is always unknown #22

Dgotlieb opened this issue Jun 13, 2016 · 8 comments

Comments

@Dgotlieb
Copy link

I tried doing the following:

`ConnectionQuality cq = ConnectionClassManager.getInstance().getCurrentBandwidthQuality();
            switch (cq) {
                case EXCELLENT: //Bandwidth over 2000 kbps.
                    Toast.makeText(MainActivity.this, "EXCELLENT", Toast.LENGTH_SHORT).show();
                    break;
                case GOOD: //Bandwidth between 550 and 2000 kbps.
                    Toast.makeText(MainActivity.this, "GOOD", Toast.LENGTH_SHORT).show();
                    break;
                case MODERATE: //Bandwidth between 150 and 550 kbps.
                    Toast.makeText(MainActivity.this, "MODERATE", Toast.LENGTH_SHORT).show();
                    break;
                case POOR: //Bandwidth under 150 kbps.
                    Toast.makeText(MainActivity.this, "POOR", Toast.LENGTH_SHORT).show();
                    break;
                case UNKNOWN: //unknown
                    Toast.makeText(MainActivity.this, "UNKNOWN", Toast.LENGTH_SHORT).show();
                   break;

              }`

And keep getting Unknown.

@sreejithr
Copy link

@Dgotlieb You probably haven't sampled any data. Try putting DeviceBandwidthSampler.getInstance().startSampling() and DeviceBandwidthSampler.getInstance().stopSampling() between some bandwidth consuming section.

@tosulc
Copy link

tosulc commented Jul 13, 2016

@sreejithr Is it mandatory to implement ConnectionClassStateChangeListener and have this initialization ConnectionClassManager.getInstance().register(this); before starting and stopping sampling?

@Dgotlieb
Copy link
Author

Tried DeviceBandwidthSampler.getInstance().startSampling() still not working..
Thanks you

@tosulc
Copy link

tosulc commented Jul 14, 2016

@SeyelentEco I see that you've been working the most on this lib. More info? :)

@sreejithr
Copy link

@tomkhan Has any traffic happened between your app start and when you check ConnectionClassManager.getInstance().getCurrentBandwidthQuality()?

@tosulc
Copy link

tosulc commented Jul 28, 2016

@sreejithr Yep. I'm starting sampling, then making network request and then stopping it. Still have no idea if "ConnectionClassManager.getInstance().register(this);" call is needed.

@WxSmile
Copy link

WxSmile commented Jun 12, 2017

@Dgotlieb Did you solve it?

@pranay18
Copy link

pranay18 commented Sep 7, 2017

I am getting the same problem. If I increase the size of data to be downloaded between the start sampling and stop sampling calls, everything works fine. But if the data being downloaded is small, I always get UNKNOWN network. Has anyone found a workaround for this issue? @Dgotlieb @sreejithr @tomkhan @zpao @WxSmile

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants