Which Android Thread Is Used In Below (Mentioned in Description) Situation? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Which Android Thread Is Used In Below (Mentioned in Description) Situation?

Hello Everyone, I want to show the user the total time they are using there mobile in a day. So, for this, when the mobile is in foreground then the counting will begun and also display the total time in notification. When the mobile goes in sleep mode the count will stop and for saving data before going to sleep mode, I am using shared preferences. But, which kind of service should I use for this job, handler, service, work manager, jobscheduler, jobintentservice or mixing of any two or anything else ? (I am targeting android O)

17th Dec 2018, 3:03 AM
Piyush Raj
Piyush Raj - avatar
2 Answers
+ 5
Hello. I am not sure at all. I asked your question to a friend who is working with Android this days. He gave me this https://developer.android.com/reference/android/app/IntentService
31st Dec 2018, 12:25 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 1
Thanks, for asking this question to your friend but Intent Service doesn't work in background in Oreo devices...
31st Dec 2018, 12:37 PM
Piyush Raj
Piyush Raj - avatar