Reva
Reva

Reputation: 225

How to get Up time in android device programmatically

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?

enter image description here

Upvotes: 9

Views: 12024

Answers (2)

user2783702
user2783702

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

Related Questions