I work with Kotlin Android Studio
Imagine this scenario.
I have an application that according to the conditions of the users, I want them to be able to access their information without access to the Internet and by using SMS.
For this, it is necessary that the application can access the content of received SMS and analyze them (receive SMS from a specific number and analyze the text of the message)
There is also a need for the application to be able to send a defined message to a specific number by accessing the user's SMS and waiting for a response.
I have watched various videos on YouTube and also read on various sites about how to receive and send SMS, but none of them worked.
I want you to give me a sample code for receiving and sending SMS
First you need to request some permissions, put this in your Manifest.xml file:
Than you can use this code directly in your Fragment to receive and send SMSs:
Or you can use it in your Activity like this: