because smsinterceptor does not work? this application.
I would like the arrival of a message with the inscription On the ringtone and vibration must be enabled, but the arrival of a message written Off, you should turn off the ringer and vibrate.
this the code:
any use, setting the ringtone doesn't sound, why?
I would like the arrival of a message with the inscription On the ringtone and vibration must be enabled, but the arrival of a message written Off, you should turn off the ringer and vibrate.
this the code:
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim notification1 As Notification
Dim SI As SmsInterceptor
End Sub
Sub Service_Create
SI.Initialize2("SI",999)
End Sub
Sub Service_Start (StartingIntent As Intent)
StartServiceAt("", DateTime.Now + 0.1 * DateTime.TicksPerMinute, False)
End Sub
Sub Service_Destroy
End Sub
Sub SI_MessageReceived (From As String, Body As String) As Boolean
ToastMessageShow(From, True)
If Body = "Off" Then
notification1.Initialize
notification1.Icon = "icon"
notification1.Vibrate = False
notification1.sound = False
notification1.AutoCancel = True
End If
If Body = "On" Then
notification1.Initialize
notification1.Icon = "icon"
notification1.Vibrate = True
notification1.sound = True
notification1.AutoCancel = False
End If
Return True
End Sub