title: Time since first boot up
body: <p>I'm developing an android application and hit the problem with determining system first boot up time. I mean i need to measure how much <strong>time already passed from device first boot up</strong>.</p>
  <p>I know about solution with listening for ACTION_BOOT_COMPLETED and save anything in SharedPreferences, but i need another solution, because this one does not work for some cases. Maybe there is any system property?</p>
  <p><strong>Use case</strong> (excerpt from <a href="https://chat.stackoverflow.com/rooms/102325/discussion-between-ankitagrawal-and-oneworld">discussion</a>)</p>
  <ol>
  <li>The filename of each file I receive from server includes a timestamp
  taken from <code>System.currentMillis()</code></li>
  <li>I compare those timestamps in order to determine, which file the most current one is.</li>
  <li>Now, the user changes system time a few months ahead.</li>
  <li>I am still able to determine the most current file downloaded after user changed system time.</li>
  <li>Now, the user changes time back to original setting.</li>
  <li>The file downloaded on step 4 always wins when comparing timestamps.</li>
  </ol>
  <p>The silver bullet to solve this problem would be a timestamp that counts seconds since first boot (after factory reset). Just like <code>SystemClock.elapsedRealtime()</code> but without reset after each boot. Unfortunately, the answers so far tell us, that this silver bullet doesn't exist.</p>
  <p>However, many answers show a great variety of options how to tackle that problem. OneWorld123 commented each answer, how that suited his needs.</p>