I m looking to add sms reading functionality in my app. The user enters his mobile number in an activity and then a sms containing one time password is sent to the user mobile phone from the server. What I want to do is trigger the app to read incoming messages after the user has entered the mobile number and is expecting incoming message from the server.
I have seen some questions like this answered here How to read the incoming message using service in background in android?
but the solution seems to be reading all the sms that come on the phone. In my case I just want the reading functionality to start only when user is expecting a sms and end when the message has been received.