-2

I'd like to ask a question about how Android app behaves after the OS has been restarted.

I have a messaging app which needs to listen to SMS messages (using the method in this post)

Assuming that the app is supporting Direct Book (Android 7.0 and above), the app will receive the SMS messages when the user unlocks the phone but without having the user to open the app. Is this understanding correct?

And, assume that the app is not or cannot support Direct Book (before Android 7.0), can the app receive SMS messages when the user unlocks the phone, without having the open the app?

Thanks!

ikevin8me
  • 4,253
  • 5
  • 44
  • 84

1 Answers1

0

it sure can

register your BroadCastListener to a Service detached from any activity's lifeCycle and do your business there in the service's class

and register another BroadCastlistener to start that service when the phone is booted

AndroidSmoker74
  • 288
  • 4
  • 19