telephonymanager - Android: How to calculate speed of the mobile internet(Upload speed) using signal strength by programatically -
in android, able find strength of signal using below code,
protected int getsignalstrength(signalstrength signal) { string ssignal = signal.tostring(); string[] parts = ssignal.split(" "); int db = -120; // no signal measured when returning -120 db // if lte if (telephonymanager.getnetworktype() == telephonymanager.network_type_lte){ int ltesignal = integer.parseint(parts[9]); // check see if get's right signal in db, signal below -2 if(ltesignal < -2) { db = ltesignal; } } // else 3g else { if (signal.getgsmsignalstrength() != 99) { int strengthinteger = -113 + 2 * signal.getgsmsignalstrength(); db = strengthinteger; } } return db; }
how calculate speed of mobile internet(upload speed / download speed) using signal strength programatically?? quesion?
facebook released library this:
https://github.com/facebook/network-connection-class
library description:
listen current network traffic in app , categorize quality of network.
Comments
Post a Comment