Android Question Error with PhoneState

kalarius

Active Member
Licensed User
Longtime User
I have use the example that record the phone call
' I want to record the incomming call


example:
Sub Process_Globals
    Dim streamer As AudioStreamer
    Dim fileName As String
    Dim PhoneState As Phone
    
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
End Sub

Sub Activity_Create(FirstRun As Boolean)
    
    streamer.Initialize
    streamer.OutputFormat = AudioStreamer.OutputFormatDefault
    streamer.AudioSource = AudioStreamer.AudioSourceDefault

    Dim recordButton As Button
    recordButton.Initialize
    recordButton.Text = "Record"
    Activity.AddView(recordButton, 100, 100, 100, 50)
    recordButton.Click += RecordButton_Click
End Sub
 

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub RecordButton_Click()
    If streamer.IsRecording Then
        streamer.StopRecording
    Else
        streamer.StartRecording
    End If
End Sub

Sub Phone_CallStart(Call As PhoneState)
    If Call.State = PhoneState.STATE_RINGING Then
        streamer.StartStream(File.DirRootExternal & "/" & Call.PhoneNumber & ".mp3")
    End If
End Sub

Sub Phone_CallEnd(Call As PhoneState)
    
    If Call.State = PhoneState.STATE_IDLE Then
        streamer.StopStream
    End If
End Sub

when I try to compile it says that I do not have declare the PhoneState
Which library i must include?
and which permision I must include to manager?

please advice
Kalarakis
 
Top