title: How to determine why my Android app stopped running?
body: <p>I wrote a simple Android app that functions as a digital sign -- all it does is download and display a (simple, static) web page, and it automatically refreshes the web page once every four hours, with no user interaction.</p>
  
  <p>It generally runs fine for days or weeks at a time, but every so often (seemingly at random intervals) when I go down to where one of the units is deployed I find that the app has mysteriously stopped running -- i.e. the device has returned to the Android desktop.</p>
  
  <p>I instrumented my app to emit log messages (both by calling Log.i and by writing text to a separate log file) and I don't see any evidence that the app crashed or that it exited intentionally; it just seems that at one point it went to sleep after refreshing the web page (as usual), and was never heard from again.  I also did a "adb shell logcat" to examine the device's system log after the fault occurred, and I didn't see any stack traces; but I'm not sure how far back that log goes.</p>
  
  <p>Does anyone have any idea why an app might mysteriously go away?  Alternatively, is there a recommended way to debug this problem?  Since it only happens once every few weeks, it's difficult to reproduce the fault.  In particular, is there a better way than "adb shell logcat" to view any crashes that may have occurred in the last few days or weeks?</p>