Android Question Read sms content

darabon

Active Member
Hi,
I'm working on the app for receiving and sending SMS to the security device
That is needing to read SMS content (for example alarm status or any command) and use the app
We know We cannot read SMS content because Android does not allow
How can I read SMS content?
 

drgottjr

Expert
Licensed User
Longtime User
you can read sms if you are not publishing on google play.
if you want to publish your app on play, you have to convince
google to allow you. they will give you the chance to explain.
 
Upvote 0

darabon

Active Member
you can read sms if you are not publishing on google play.
if you want to publish your app on play, you have to convince
google to allow you. they will give you the chance to explain.
Which way is the best and most stable?
Can you give a sample or link?
Because there are many topics for it but all topics not good
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
the most "stable" is probably sending an sms with an intent. no permissions required. uses system resources

if you're sending messages with code, there is no guarantee google will continue to allow it.
in any case, read this link:

here is what i use to send an sms:

B4X:
    ' include phone library
   ' don't forget sms permission in manifest
    Dim sms As PhoneSms
    Dim phevent As PhoneEvents
    phevent.Initialize("phevent")

    sms.Send("99999999", "this is an sms")

' these subs report status
Sub phenvent_SmsSentStatus (Success As Boolean, ErrorMessage As String, PhoneNumber As String, Intent As Intent)
    ToastMessageShow("Text sent to " & PhoneNumber & Success, False)
End Sub

Sub phevent_SmsDelivered (PhoneNumber As String, Intent As Intent)
    ToastMessageShow("SMS delivered to " & PhoneNumber, False)
End Sub
)

to read sms, you'll need a receiver:
 
Upvote 0

darabon

Active Member
the most "stable" is probably sending an sms with an intent. no permissions required. uses system resources

if you're sending messages with code, there is no guarantee google will continue to allow it.
in any case, read this link:

here is what i use to send an sms:

B4X:
    ' include phone library
   ' don't forget sms permission in manifest
    Dim sms As PhoneSms
    Dim phevent As PhoneEvents
    phevent.Initialize("phevent")

    sms.Send("99999999", "this is an sms")

' these subs report status
Sub phenvent_SmsSentStatus (Success As Boolean, ErrorMessage As String, PhoneNumber As String, Intent As Intent)
    ToastMessageShow("Text sent to " & PhoneNumber & Success, False)
End Sub

Sub phevent_SmsDelivered (PhoneNumber As String, Intent As Intent)
    ToastMessageShow("SMS delivered to " & PhoneNumber, False)
End Sub
)

to read sms, you'll need a receiver:
Thankilo
 
Upvote 0
Top