Reputation: 225
I am working on developing a settings kind of application in android where i need to retrieve the details of the device I am having difficulty in finding the following Signal Strength, Service State and Up time.
How to find these 3 current values? Where can i get the sample settings application?
Upvotes: 9
Views: 12024
Reputation: 8681
Up-time:
http://developer.android.com/reference/android/os/SystemClock.html#uptimeMillis()
Service State:
http://developer.android.com/reference/android/telephony/ServiceState.html
Signal Strength:
http://developer.android.com/reference/android/telephony/SignalStrength.html#getGsmSignalStrength()
And here's a link to the platform setting:
Upvotes: 19
Reputation:
public void onReceive(WifiManager wifiManager) {
int numberOfLevels=5;
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
int level=WifiManager.calculateSignalLevel(wifiInfo.getRssi(), numberOfLevels);
System.out.println("Bars =" +level);
}
This may Provide you the Signal Strength there is a refrence Below
How to get signal strength of connected WiFi android? May be this will help you
Upvotes: 0