Android Question Need to read SMS

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi,

I need to read sms. My app is not to be on play store.
I am trying to run the code as in https://www.b4x.com/android/forum/threads/reading-sms-in-the-background.124180/#post-776115
but in the service
service starting:
If StartingIntent.Action = "android.provider.Telephony.SMS_RECEIVED" Then
It fails.
Error
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0

I have added permission in manifest. After starting the app i send sms to my phone but it does not read the sms.
Is there any way out.


Pls guide me.

Thanks
Juzer
 

Juzer Hussain

Active Member
Licensed User
Longtime User
Its WORKING Erel, Sorry, The error was coming while reading the array.
One has to start service and wait for SMS. Upon receiving SMS if condition will be met automatically.
Thank You .
Juzer
 
Upvote 0
Top