'Activity module
Sub Process_Globals
Dim VR As VoiceRecognition
Dim MyText as string
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
VR.Initialize("VR")
End If
Activity.LoadLayout("1")
'
'supportati
'
If VR.IsSupported Then
ToastMessageShow("Voice recognition is supported.", False)
Else
ToastMessageShow("Voice recognition is not supported.", True)
End If
VR.Prompt = "Say your message" ' Parla il messaggio
End Sub
Sub Button1_Click
' chiamate l'attività di riconoscimento vocale esterno. Evento risultato sarà sollevata.
VR.Listen 'calls the voice recognition external activity. Result event will be raised.
End Sub
Sub VR_Result (Success As Boolean, Texts As List)
If Success = True Then
ToastMessageShow(Texts.Get(0), True)
MyText = Texts.Get(0)
' SendMyText
Dim i As Intent
i.Initialize(i.ACTION_VIEW, "sms:0123456789") ' Phone Number | Numero di telefono
i.PutExtra("sms_body", MyText )
StartActivity(i)
End If
End Sub