Question

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,

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top