Android Question Calls from specifed number

sseaand

Member
Licensed User
Longtime User
I need to do my own call history with a ULV or CLV.
How to get a list with all calls from a specifed number?
 

Brandsum

Well-Known Member
Licensed User
Include Phone Library.

B4X:
Dim Calls As List
Dim CallLog As CallLog
Calls = CallLog.GetAll(0) 'Get the last 10 calls
For Each c As CallItem In Calls.Size
    If c.Number = "YOUR SPECIFIC NUMBER" Then
        Dim callType, name As String
        Select c.CallType
            Case c.TYPE_INCOMING
                callType="Incoming"
            Case c.TYPE_MISSED
                callType = "Missed"
            Case c.TYPE_OUTGOING
                callType = "Outgoing"
        End Select
        name = c.CachedName
        If name = "" Then name = "N/A"
        Log("Number=" & c.Number & ", Name=" & name _
    & ", Type=" & callType & ", Duration=" & c.Duration & "Sec, Date=" & DateTime.Date(c.Date))
    End If
Next
 
Upvote 0
Top