문제

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