I need to know if there is any class or Alarm in android or IOS that tells if the mobile is Down or UP, or just started or restarted. (and for how long!)

i'm creating a logging system, and i need to log the different state of the mobile all along the day.

Thanks in advance,

有帮助吗?

解决方案

You need to add send notification from you app (native in iOS and Android) to your remote logging server.

Android as well as iOS have Application life cycle. Which provides you with callback if app is in running state , background , foreground etc.enter image description here

There is a similar one for Android

The idea is that both of them have singleton for application and they have callbacks for app transition stage

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top