I am developing an android app where music is being streamed. Now I want to get the internet speed of the device, it may be wifi as well as mobile network speed. I want this to set the quality of the audio file according to the network speed, i.e. I want to introduce an auto streaming quality option.
So, I have read many post but not finding any solution which could target atleast minimum api level 21 i.e. android 5.0. I have found a solution in this post but the answer is only for api level 23, i.e. Android 6.
I have also found that by downloading a file we can get the internet speed but it may create a negative effect because we can't keep downloading file every time to check the internet speed. I have also found that we could ping a server and test the speed but I do not want to make useless network activity, which may eat up users mobile data.