title: How to count the effective time of smartphone usage (without locks time)
body: <p>I need to count the phone real usage Time i.e. when the user press a button I need to start something for counting the time that the screen is on but when the user locks the phone the counter must be stopped and It must be restarted when the user unlocks the smartphone. In this way a can see a counter of hours, minutes and seconds of real smartphone usage time.</p>
  
  <p>How can I approach to this logic?
  What kind of components can I use? Service, thread and broadcastReceiver? How can I interconnect them?</p>