Android Question App not sending sms

Hello there guys, in my app i want it to reply a message to any incoming sms and incoming phone number but the app dont send, i have set sdk target to 26 but still it doesnt works , pls anyone help me ..
[CODE lang="b4x" title="First code"]#Region Module Attributes

#StartAtBoot: True

#End Region


'Service module

Sub Process_Globals

Public ajiya As List

Public ajiya2 As List

Dim Sms As PhoneSms

Dim PE As PhoneEvents

Dim AC As AnswerCall

Dim PhoneId As PhoneId

Dim phone As Phone

Dim TTS1 As TTS

Dim SI As SmsInterceptor

'Dim audio1 As MediaPlayer

Public s As PhoneSms

End Sub

Sub Service_Create

PE.InitializeWithPhoneState("PE",PhoneId)

AC.Initialize("AnswerCall")

ajiya.Initialize

ajiya2.Initialize

SI.Initialize2("SI",999)

TTS1.Initialize("TTS1")

Log("Service created")

End Sub


Sub Service_Start



Log("Service started.")



'StartServiceAt(tura1,3000,True)



Service.StopAutomaticForeground

End Sub

Sub SI_MessageReceived (From As String, Body As String) As Boolean



'TTS1.Speak("Hello test.", True)

ajiya.Add(From)

StartService(tura2)







's.Send(From, "I am praying right now, try reaching me later on . @Danj soft")


Return True





End Sub


Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)

Log("PhoneStateChanged, State = " & State & ", IncomingNumber = " & IncomingNumber)

Log(Intent.ExtrasToString)

ToastMessageShow(IncomingNumber,False)

AC.LetPhoneRing(3000)

If AC.isRinging == True Then

'TTS1.Speak("Hello test.", True)

'Sms.Send(IncomingNumber, "tt")

ajiya.Add(IncomingNumber)

AC.AnswerPhone



End If

AC.enableSpeakerphone

StartService(tura1)





End Sub

Sub tura1

'Sleep(7000)

s.Send(ajiya.Get(0), "I am praying right now, try reaching me later on . @Danj soft")

ajiya.Clear



End Sub

Sub tura2

'Sleep(7000)

s.Send(ajiya2.Get(0), "I am praying right now, try reaching me later on . @Danj soft")

ajiya2.Clear



End Sub



Sub Service_Destroy



End Sub[/CODE]
[CODE lang="b4x" title="Second code"]#Region Service Attributes
#StartAtBoot: True

#End Region

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private myTorch As flashTorch
Dim WiFi1 As MLwifi

Dim now As Long
Dim d,m As String
DateTime.DateFormat = "dd:mm "
Dim icomph As String
Dim Sms As PhoneSms
'Dim ajiya As List
'Dim ajiya2 As List
'Dim ajiya3 As String
'THE CODE FOR OPNING LINK Dim phoneintents As PhoneIntents


Dim SSID As String
Dim r As Reflector
Dim WiFi1 As MLwifi
Public kunna As String
Dim p As Phone

End Sub

Sub Service_Create
myTorch.Initialize
End Sub

Sub Service_Start
StartServiceAt(CheckWiFi,10,True)
Service.StopAutomaticForeground 'Call this when the background task completes (if there is one)
End Sub

Sub CheckWiFi

If WiFi1.isWifiEnabled = True And WiFi1.isSavedWifiAP("Redmi") = True Then
WiFi1.connectWifiAP("Redmi")


Else
If WiFi1.isWifiEnabled = True And WiFi1.WifiSSID == "" Then
If WiFi1.saveWifiAP("Redmi", 0 ,"",True) = True Then
WiFi1.connectWifiAP("Redmi")

End If
End If

End If


If WiFi1.isWifiEnabled = True And WiFi1.WifiSSID == "Redmi" Then
P.SetRingerMode(p.RINGER_SILENT)
kunna = "cn"

Else If WiFi1.isWifiEnabled = True And WiFi1.WifiSSID == "" Then
P.SetRingerMode(p.RINGER_Normal)
End If
If myTorch.isTorchSupported Then
'Yes!, take control of the camera!
myTorch.initTorch
Else

'MsgboxAsync("Your device doesn't support Torch mode","Torch ERROR")
End If
If WiFi1.isWifiEnabled = True And WiFi1.WifiSSID == "Redmi" Then
If Starter.torch = "on" Then
myTorch.Torch=True
Else
myTorch.Torch=False
End If

End If
'If baya.ajiya.Get(0) <> False Then
'baya.s.Send(baya.ajiya.Get(0), "I am praying right now, try reaching me later on . @Danj soft")
'baya.ajiya.Clear
'End If
'If baya.ajiya2.Get(0) <> False Then
'baya.s.Send(baya.ajiya2.Get(0), "I am praying right now, try reaching me later on . @Danj soft")
'baya.ajiya2.Clear

'End If




d = DateTime.GetHour(DateTime.Now)
m = DateTime.GetMinute(DateTime.Now)
If d = 2 And m = 1 Then
WiFi1.EnableWifi(True)

Else If d = 17 And m = 5 Then

Else If d = 26 And m = 2 Then

Else If d = 19 And m = 12 Then

Else If d = 30 And m = 4 Then


End If





End Sub
Sub Service_Destroy

End Sub[/CODE]
 
Last edited:
Hello, the topic was discussed many times in the forum. This link may help you a little ...

P.S.
In addition, enter the SMS phrase in the search engine and you will see how much you need to do to achieve your goal ...
 
Last edited:
Upvote 0
Thanks alot
Hello, the topic was discussed many times in the forum. This link may help you a little ...

P.S.
In addition, enter the SMS phrase in the search engine and you will see how much you need to do to achieve your goal ...
 
Upvote 0
Back
Top