Total Uptime On Android And Iphone
As far as I know both OSes allow me to obtain the current uptime since the last boot, but is there a way to obtain the total uptime since the OS was first started, or since my appl
Solution 1:
Speaking for Android:
is there a way to obtain the total uptime since the OS was first started
Not directly, but see below for a quasi-workaround.
or since my application was installed
PackageManager
and getPackageInfo()
can return you a PackageInfo
object for some package, such as your own package name. That has a long firstInstallTime
that will indicate when the package was installed.
Since you can get PackageInfo
objects for any package, you're welcome to cook up some algorithm to try to approximate the time the device was first used, by finding the time of the oldest app install. However, you'd have to filter out pre-installed apps, and that will get tricky. I certainly would not want to rely upon this.
Post a Comment for "Total Uptime On Android And Iphone"