Android adding SMS Verification Like WhatsApp – Part 2

In the 1st part of this article we have learned how to create the required REST API for this app. In this part we are going to see how to build the android app that interact with the API to receive the SMS and get it verified. As this project uses volley to make http calls, I suggest you go through my Volley tutorial to know the usage of volley. Also you need to have basic knowledge on android services and broadcast receivers.

We are going to use SMS broadcast receiver to read the sms whenever device receives it and an Intent Service to make the http calls which sends the OTP to server to get it verified.

6. Creating the Android App

This app contains two activities. One with a ViewPager with two pages. One page is to enter the mobile number and other page is to enter the OTP. The second activity is to display the logged in user profile information.

1. In Android Studio, create a new project by navigating to File ⇒ New Project and fill all the required details. When it prompts to select a default activity, select Blank Activity and proceed.

2. Open build.gradle located under app folder and add volley library dependency by adding com.mcxiaoke.volley:library-aar:1.0.0.

6.1 Making the App Material

This step is optional but I recommend you go through it as it improves your knowledge on material design. Follow my Material Design tutorial to get to know how to make your android app material design ready.

3. Open strings.xml located under res ⇒ values and add below string values.

Now if you run the app, you can see the top notification bar color changed which means the material design theme is applied.

3. Now create five packages named activity, app, helper, receiver and service. These packages helps in keeping the project organized.

Below is screenshot of the final project of this tutorial.

4. Under app package, create a class named Config.java. This class contains very important app configuration information.

>URL_REQUEST_SMS and URL_VERIFY_OTP should be correct. The ip address should match with your localhost PC.

>SMS_ORIGIN should match the value in your PHP project’s Config.php.

>OTP_DELIMITER should also match the value in your PHP project’s Config.php.

package info.androidhive.smsverification.app;
/**
* Created by Ravi on 08/07/15.
*/
public class Config {
// server URL configuration
public static final String URL_REQUEST_SMS = "http://192.168.0.101/android_sms/msg91/request_sms.php";
public static final String URL_VERIFY_OTP = "http://192.168.0.101/android_sms/msg91/verify_otp.php";
// SMS provider identification
// It should match with your SMS gateway origin
// You can use MSGIND, TESTER and ALERTS as sender ID
// If you want custom sender Id, approve MSG91 to get one
public static final String SMS_ORIGIN = "ANHIVE";
// special character to prefix the otp. Make sure this character appears only once in the sms
public static final String OTP_DELIMITER = ":";
}

5. Under app package, create a class named MyApplication.java. This class initiates the volley core objects. This class extends from Application class which should be added in your AndroidManifest.xml <application> tag.

6.1 Creating SMS Receiver

Now we’ll see how to add a receiver which will be triggered whenever the device receives an SMS. Also we’ll add an Intent Service to make the http calls when the app is not running.

9. Under service package, create a class named HttpService.java and extend this class from IntentService. This service is useful to make the HTTP calls when the app is in background or killed. We’ll use this Intent Service to send the OTP to our server if the app is killed before receiving the SMS.

9. Now under receiver package, create a class named SmsReceiver.java and extend the class from BroadcastReceiver. This is a broadcast receiver class which will be triggered whenever user device receives the SMS.

6.2 Creating Mobile Login Screen

Now we have all the core logic ready. Let’s add the first activity to enter the mobile number and OTP.

12. Under res ⇒ layout, create an xml layout named activity_sms.xml and add below code. This layout contains a ViewPager with two pages. In one page we ask the user to enter his mobile number. In the second page we prompt the user to enter the OTP if the automatic sms verification fails.

Now run the app and test it once. Make sure that you have correct ip address of your localhost in Config.java

6.2 Displaying logged in User Profile

Displaying the logged in user information is pretty straight forward. Previously the user information is store in Shared Preferences in HttpService.class. In this activity we have to read the information from shared preferences and display it on the screen.

7. Testing the App

> Make sure that your device and the PC running the php project are under the same wifi network.

> Keep correct username, password and database name in Config.php

> Give the correct MSG91_AUTH_KEY Key in Config.php

> Make sure that MSG91_SENDER_ID in Config.java and SMS_ORIGIN in Config.java are equal.

> Keep the correct ip address of your localhost in Config.java. On windows run ipconfig in command prompt to get the ip address.

I know running this app is little tricky for a beginner. But the following the above steps correctly will help you a lot. If you are still facing the problem in running this app, please do comment below.

Hi there! I am Founder at androidhive and programming enthusiast. My skills includes Android, iOS, PHP, Ruby on Rails and lot more. If you have any idea that you would want me to develop? Let’s talk: ravi@androidhive.info

can any one have idea about such example in java in place of php(part one of this example)??? because i don’t know php please help if any one can….Thanks in advance….???

EBLiS

Hi Ravi
Nice job,But there’s a problem
In an IntentService the service dies as soon as it finishes the last line in onHandleIntent(), so the async volley onResponse() call won’t behave nicely, the solution is to use a service instead or make the call synchronous

@disqus_VwSWmULpCr:disqus : There is no such problem as EBLiS says even if the IntentService dies as soon as it finishes. You can test this by putting Log text at the end of both IntentService.onRecieve and Volley’s onResponse methods. then you can see that even after IntentSerivice dies Volley recieve and respond to the response. I think it is because the Context object still lives in memory.

Rajesh J Nair

Nice Article Ravi… Helpful….
Can we detect the phone no Automatically?

SQL – Structured Query Language. Its a common language to perform queries on to any database like MySQL, SQLServer, Oracle, SQLite etc.,

SQLite – Is a database just like MySQL, Oracle etc.,

YoungUser

Hi Ravi,

First, thank you for your work, it is really helpfull to me !
But I have some questions to create a kind of ecommerce application.

When the user installs the application and launches it for the first time, the login page appears , with a link to register. Let’s suppose the guy creates his account, login with it and turn of his phone. Two days later he launch the app again , how to avoid the login screen? Do I have to make a blank activity (which would be the launcher activity) and check if an account is stored in memory or something like that ? and do you have some tutorial for that? 😀

You are correct. Make the login screen as launcher activity. Check the user stored data each time app launches. Stay in login screen if user is not logged in or launch the main activity if he is already logged in.

Here the trick is check the session before calling setContentView() to avoid the login view to be shown to user.

Keep the user session in Shared Preferences, SQLite or Accounts.

Trey Rosius

Hmmm @Ravi Tamada, does it make sense if i create a splash screen to check if user is logged in or not.Like if user is logged in, take him to the home page, else take him to the login page?

Yeah, It seems PHP version difference. It’s actually my problem. I still left older mysql functions in DB_Connect.php. Try to make them mysqli.

yajas sonu

heloo, i ve doubt please help me, in my signup page if a user sign up and register in the page how the datas should be stored in my server or database? how to connect my app to database for storing and retrieving the datas? kindly please help me..

i see that u don’t answer the question’s there so i will ask u here if u don’t mind
i created the app successfully but when i run it, it show’s the Dialog and when the Dialog’s go away
i just see a blank page

i really appreciate that if you answer’d me ,i searched for hour’s and no clue i didn’t find the answer on stackOverFlow or even the whole google and i don’t know what’s the problem
and my logCat not even helping me , so can you help me please? i really want it, thank’s
if u can’t answer here please mail me at ayob0631@gmail.com

I wanted to learn this since long time and finally Android hive posted this, thanks a ton !!!

Praneeth Nandi

Hello Ravi garu Iam using Eclipse i added Volley in java built path iam getting errors like FETAL EXCEPTION Myapplication class not found can u please give me the sugession…. i required it urgent it will help me more……

and even before execution, my manifest file keeps flagging the same error on

android:name=”.app.MyApplication”

The amazing thing is the copy i downloaded online works fine.
I have been debugging this same issue for about 2 days and i cant seem to figure out my own app
is flagging that message that “MyApplication is not assignable to android.app.Activity”

can you guyz tell me what i am not doing right cos my eyez are already itching me!

Edward Rana

Dear Sir .. How can I check If User send a Fake OTP by Fake sms Sender App.
For more security what can I add in your code??

Nothing will happen if he uses FAKE OTP as the OTP has to matched in our MySQL database.

sam xfido

great tutorial bro!!!!! im beginner in android app devlopment !! wen i try to connect it showing java null exception and when i try to check the api in postman its showing “Access denied for user ‘root’@’localhost’ (using password: YES) in C:wampwwwandroid_smsincludeDbConnect.php on line “”. plzz do help !! thanks in advance

Akanksha Verma

in Config.php, change the value of password to ”
see this:
define(‘DB_USERNAME’, ‘root’);
define(‘DB_PASSWORD’, ”);

Nikhil Gaur

Hi, I found two issues with your above application.

1. If sending SMS takes longer then request gets terminated automatically. So please tell me where I can increase the timeout for all requests.

2. When I tried to use your code in both the articles it fires request_sms request two times. Do you know how can I resolve this?

I have one issue .
I got this error :
java.net.ConnectException: failed to connect to /127.0.0.1 (port 80) after 2500ms: isConnected failed: ECONNREFUSED (Connection refused)

Please help @ravi8x:disqus .

mahmoud Abbas

it work…thanks ravi

Karjol GT

Ravi,

thanks for the nice article.

but in the Application when i click next button i get this error
Error:value?>of type java.lang.String cannot be converted to JasonObject

Varun Vashista

hey ravi after using the code above in my app exactly everything is fine but in database two fields are adding and two sms are getting to the mobile which i used to register please help me about this thank you its a bit urgent

Hey varun, I am talking about manufacturers who build the mobile devices like HTC, Lenovo, LG etc., They normally build a flavour of their own OS on top of Android OS. This is why few things won’t work on their devices.

Varun Vashista

ohh!! thanks buddy 🙂 thank you so much 🙂

Raunak Bidasaria

Hello, I am bit new to this and I have implemented most of the project. I have been using eclipse and most of the errors I am getting is in the themes of the xml files. I have added successful version of library as well. I would be glad if u could help me with the issue.

Nikhil Besra

Everything is working fine on POSTMAN.but when i try to run app in Android studio,it is not able to post params. What could be the reason??

Hai i want this project..plz someone guide that how to run this project..

Rashid mohammed

Hello Ravi sir. First of all, thank you for providing extremely useful tutorials like this. The codes worked well for me except this problem, every time I register with the app I get OTP twice and the same details are entered twice to the database. The two otps reach my phone almost instantly without any delay. To check the issue, In the request_sms.php file, I removed the function sendSms($mobile, $otp); from the if statement and when I registered with the app, database stores details only once. But when I add sendSms($mobile, $otp); I am getting OTP twice and the user details are entered twice in the database. Sir, please help me in this case. I am just a helpless beginner.

Hello, The tutorials are best in the way u have described and I really wanna thank you for the systematic way used for presentation. Unfortunately, I am stuck at the moment. While I enter my details of email , name and phone; I get an error popping out as “java.net.SocketException:socketfailed:EACCES(permission denied)”. I would be deeply obliged to you if u could consider my query and help me with the issue. THanks in advance

sameer khan

Try with,

instead of,

and the permission should be before the application tag

Rakesh Sahani

{“error”:true,”message”:”Sorry! mobile number is not valid or missing.”}

Santhoshkumar

FATAL EXCEPTION: main java.lang.NullPointerException at com.example.inodesys.android_otp.activity.SmsActivity.requestForSMS(SmsActivity.java:254) at com.example.inodesys.android_otp.activity.SmsActivity.validateForm(SmsActivity.java:163) at com.example.inodesys.android_otp.activity.SmsActivity.onClick(SmsActivity.java:123) at android.view.View.performClick(View.java:4421) at android.view.View$PerformClick.run(View.java:17904) at android.os.Handler.handleCallback(Handler.java:730) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5214) at java.lang.reflect.Method.invokeNative(NativeMethod) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) at dalvik.system.NativeStart.main(Native Method)

Pls clear this eror

Shan Santhoshkumar

E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NullPointerException
at com.example.inodesys.android_otp.activity.SmsActivity.requestForSMS(SmsActivity.java:254)
at com.example.inodesys.android_otp.activity.SmsActivity.validateForm(SmsActivity.java:163)
at com.example.inodesys.android_otp.activity.SmsActivity.onClick(SmsActivity.java:123)
at android.view.View.performClick(View.java:4421)
at android.view.View$PerformClick.run(View.java:17904)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5214)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
at dalvik.system.NativeStart.main(Native Method)

sh.f

Hello Mr Ravi

sh.f

@ravi8x:disqus

sh.f

.

Ishita Sinha

Hi, Sir,

I am new to android. This is a great tutorial and I have been able to implement it fully. I have one small problem, though. On some smaller devices, the soft keyboard hides the EditText views in the ViewPager. Adding adjustResize or adjustPan in the manifest doesn’t seem to work. Please let me know how I can fix this. Thanks.

In order to adjustResize work, the parent layout should be RelativeLayout. What is your parent layout?

Ishita Sinha

Thank you so much for the quick reply. My parent layout is a RelativeLayout, inside that I have the ViewPager, inside the ViewPager there are two LinearLayouts. Should I change those LinearLayouts to RelativeLayouts?

It happens because of lot of factors. Can you try setting adjustPan through code in activity or fragment.

Ishita Sinha

Thank you for suggesting this. Apparently the problem was the hard-coded “125dp” as the app icon’s top margin. I changed the LinearLayout’s gravity to be “center_horizontal|center_vertical” and removed the layout_marginTop from the icon’s attributes. Now the keyboard is pushing up the EditTexts as desired, and all the text/images are also centered on the screen. 🙂

Hi , sir
i am new to android . just i tried to do as u did above with different layout , as i’m unable to slide page to otp layout ..please help me as i’m trying from last one week .. tried every thing , you are my my last hope . please do suggest so that i can come out of this issue …any suggestion will make my 7 horrible day .. please

Hello Ravi,
I have tried implementing the above code and everything works fine except the part where it receives the OTP automatically. I tried looking for the issue and found out that the receiver is never called. TIA

S H

Hello Ravi, instead of msg91 api can i use twilio?

HARDIK AMAL

Working fine in pre-marshmallow…receiver not working in marshmallow…how do i solve this?

hi , i followed ur tutorial , and i removed name and email id and making it register through just phone number which is working perfectly fine . now i want to create a profile page , in which i want user to allow set their profile . in that they should b able to set profile image and name . and i wanna share that information on database . can u please help . and is their any way to contact u directly

Ashiwani N

Everything is working fine but when I’m clicking NEXT then I got the toast message “Error : Value Config.php of type java.lang.String cannot be converted to JSONObject”. This error belongs to SmsActivity when I debugged the project.

Pritam Kumar Shahi

How to run the php server can anyone help me?

Anchal Singh

Everything is working fine but when I’m clicking NEXT then I got the toast message “Error : Value Config.php of type java.lang.String cannot be converted to JSONObject”. This error belongs to SmsActivity when I debugged the project.

Thanks for your valuable support ,the old error has changes to a new one…something like error 404.

Ashiwani N

I think that should be related with server details. If you are using wampserver as localhost check the details you’ve entered in connection.php file (hostname, user,password,databseName) that is present in C:wamp64www

Ashiwani N

Line 4, 5 are added bcoz json object starts n end with braces. Given code is of SmsActivity.java

somesh waran

Hi Ravi. You are the Life saver man. For many developers you are the God.

somesh waran

My question will be simple. But I don’t have a choice buddy. Please help me Ravi. Could you plese tell me what is this statement in request_sms.php file
” //Your message to send, Add URL encoding here.
$message = urlencode(“Hello! Welcome to AndroidHive. Your OPT is $otp_prefix 575883″);”
I dont know know what to be replaced in place of “Hello! Welcome to AndroidHive. Your OPT is $otp_prefix 575883”. Bcos everything is working great but am getting the same msg in mobile. But I am getting the password in server. Please help me. Please help me with what to be replaced with this. Please help me guys.

Tirumalesh kallepalli

‘$otp_prefix $otp’ in requestsms.php file remove the number and keep this you will get the random otp instead of 575883 no hope this helps…

somesh waran

I got issue resolved guys. Sorry for the trouble. Seriously Ravi, you are really awesome. Really Ravi bcos of you only am surviving as an Android developer. Thank you so much.

Is there any way you find? One way is sending via push notification but that is after login.

rimsha riaz

no, i could not find

rimsha riaz

can you check code of php if i will send you

final

Hi Ravi this is my error Error:Valueof type java.lang.String cannot be converted to JSONObject. You told me that I have some errors in php, I checked the php pages every thing is fine, can you pl particularly I which php page error .

Have you gone through the first part of this tutorial.
Do know where is the problem the problem is in either DbConnect.php or DbHandler.php.
But can’t figure out what is the actual problem if you come with this solution let me know and yeah do try what i told you add the mounted name in your path also because 404 error is for file not found

when i run the programme .And it such first programme for me ..can u please provide me this tutorial on video.By video i easily add all method ..but by this i can’t understand properly but you show step by step but rather than i am bigner in the project .Please provide me this coding on video.. on ahanasony8@gmail.com

Ahana

11-13 22:41:04.351 2788-2815/com.example.user.newproject W/EGL_emulation: eglSurfaceAttrib not implemented
11-13 22:41:04.351 2788-2815/com.example.user.newproject W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xb2ef3b20, error=EGL_SUCCESS
11-13 22:41:06.320 2788-2815/com.example.user.newproject E/Surface: getSlotFromBufferLocked: unknown buffer: 0xab1ba6b0
I got this error wen i run the programme how i solve this .please reply as soon as possible..

sameer khan

Hi Ravi,
What do i do to show this login otp screen only one time. Mobile gets bind with app until the user deletes the app from his/her mobile device.

You can use shared preferences to store login status. Keep a boolean flag true in shared preferences once the otp is verified. I already explained it by using createLogin() method in PrefManager.java

sameer khan

Not working sir
Since i have used your code exactly as written in PrefManager.java but when i open my app again the login screen shows again 🙁

sameer khan

even if i delete the app it still moves to another screen i don’t know how its working even after i delete my app and test it again the first screen skips and second screen pops first. Sir Please guide what to do in sheer pressure right now

Ahana

11-14 00:03:21.367 2666-2711/com.example.user.newproject E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb4058270
i got this error when i run the programe how can i solve this

Thank you Ravi,
I am doing a project under training and my request otp is working fine but when i verify my app stop closes by giving the following error in log-Unable to instantiate activity ComponentInfo{appid/package.AnotherActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘android.view.View android.view.Window.findViewById(int)’ on a null object reference…….since i am doing a lot more maybe that’s where i am wrong because your is working fine for first part if you could help a little please mention some discussion chat so that i could share my problem with you privately……And please do reply sooner you reply really late sometimes you don’t even reply.

Regards
Sameer Khan
Trainee Mobile Developer

Ahana

can u please help me when i run the programme it show error

11-14 00:03:21.367 2666-2711/com.example.user.newproject E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb4058270.
how i solve this if you know how to solve this problem so please help to solve an reply as soon as possible please reply and help me to solve this

sameer khan

post your complete error or ask on stack overflow and share the question link i’ll try my best to help you. I have done request and verify otp succesfully but still trying to save the loggedIn mobile number so that login screen comes only once if we successfully logged into the app
Leaving i can share your problem try to resolve it

Ahana

can u provide me video of this coding i can better understand from video rather that written ..please provide me video ..I am such big thanks to you.please provide me ..thanku for supporting me and when i enter name ,email or passwrd it contain but not show any thing and that name not saved in database user screen..please help me to solve it

sameer khan

But still post your question on stackoverflow i need some points. And if you get everything from my video and my answer on stackoverflow mark it as verified and upvote it :D. Please share your question link here
And in question specify clearly what you are trying to do and where you have problem OK.
I’ll share my video link soon.

i got this error ,sry if u can’t understand what i want to say to you because i am biggner in this that’s why i don’t know more about it ,when i run the programe i having this type error any it do not load another second page .if u understand what i want to say and where i got error so please help me and provide me video.thanks

which device version should i use for run this programme …look if you provide me video from starting to end, to see that video i understand that where i happend mistake during add this content ,thus can u please provide me full video with all content with device version that which i use for this.i hope you understand why i insist you for video .if u provide me video so please provide today as possible .thanks
if you not so i understand…but reply soon as possible

sameer khan

Not possible i am in office and i am working…..i’ll be free tomorrow i’ll upload the test run video tomorrow for this tutorial. Thank You. And if you want then confirm that you need it for tomorrow else i am not going to upload. End of this discussion.

sameer khan

This is due to your device version i guess this issue is only for marshmallow devices…..see that surface error on google why does it happen? still if you want to test your code try running on version 5 lollypop i guess that would resolve your issue. I did only 1 month on android so i am under training and nobody trains me cause i am self learning.Dig it deeper and enjoy programming 😉

Ahana

Ok thanks ,can u talk with me on whatsapp because on whatsapp i can
briefly explain from where i having error .please if u do this i am big
thankfull to you ..and explain briefly my problem rather then here..so
please understand..thanks

sameer khan

OK but not today because i am working on something i’ll try my best share your contact i’l text as soon as i’ll get free that would probably on saturday or sunday

sameer khan

but i guess i have resolved your problem right? have you even tried what i told you?

Ahana

yes,please solve my problem soon as possible ..by video or any other source..

Ahana

but i submit my project on tomorrow. i having more work to do in the project .please if you provide your contact today as possible.thanks

sameer khan

Sorry i can’t really i can understand your problem since i am also a trainee but couldn’t help beyond this. Bye and Enjoy Programming 😉

Ahana

ok no problem i can understand .thanks for above help.

Mritunjay Singh Khichi

does it manage session means after login i close app and again then open i dont have to login again

sameer khan

Hello Ravi,
Ravi can you tell me one thing more how to delete all preferences when the app is deleted since all mobile numbers are saved even when i delete my app and rerun the project

sameer khan

Hello Ravi, thanks for such a great tutorial did almost everything and working perfectly but SmsReciever is not working as it should be since i am getting error in toast text like java.lang error dont know what is the case and how to resolve it i guess it is not detecting incoming sms. Since i have two sim slot maybe that could be the issue. Help me on this final and last part please!

and in Toast message which i am receiving in my UI is “Attemp to invoke virtual method null object reference ” i didn’t read the whole since that message for around two seconds atmost
Ravi Please help me !!!

You need to add MyApplication to AndroidManifest.xml file application tag. Check the 6th point in the same article.

Akshay Rudraksha

Thanks for response Ravi, I did tried that but it gives me error “class or interface expected.”

Krishna Chaithanya

Hello Ravi , I have done exactly as you said. Using Postman I am able to run it successfully . But , with mobile app it is neither showing errors in logcat nor getting OTP to my mobile. HELP me out please.

hello ravi,
The auto OTP verification works fine,but back pressed from main activity means ,i want to close my app,no need to show SmsActivity. How to do this?,How to finish the HttpService (intentService).

shashi patil

call finish()

Ahana

Hello great tutorial can you tell me one thing that when i run program on emulator it runs well and works perfectly but when i run on android real device so that time it show me error java.net.ConnectException:failed to connect to localhost/10.0.2.2(port 80) after 2500ms: isConnected failed ECONNREFUSED (Connection refused ) how i slve this please help me and reply as soon as possible..thanks

Sir i am using another sms provider.. everything is working fine otp is generated and save in database but sms is not received kindly help me out that what changes should i make acording to my sms provider..

ashwin

same problem here..any solution?

Jumbo

Hi Sir.I want to activate a ‘take picture’ button without user
interaction just as soon as an SMS is read from a predefined number,How do i go about it?

You can use LocalBroadCast to send notification to your activity when the sms is read.

amir fallahi

Hi
what if my app market do not allow me to use READ_SMS permission?they have forced us to remove this permission and they noticed that we should just use RECEIVE_SMS permission. Is there any way to bring sms content to our app without reading it directly? I mean can we really avoid using READ_SMS permission. please don’t say SMS_RETRIEVER Api because it will need the message which we send to user have specific pattern