Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Up time in android device programmatically

Tags:

android

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

like image 506
Reva Avatar asked Mar 31 '14 09:03

Reva


1 Answers

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:

https://github.com/android/platform_packages_apps_settings/blob/master/src/com/android/settings/deviceinfo/Status.java

like image 146
Dunken Avatar answered Oct 14 '22 15:10

Dunken