Android Question Android permissions

stratus

Active Member
Licensed User
Longtime User
I try to access my phone's call logs using this code
B4X:
Dim Calls As List
   Calls.Initialize
   Dim CallLog As CallLog
   Calls = CallLog.GetAll(10) 'Get the last 10 calls
   For i = 0 To Calls.Size - 1
     Dim c As CallItem
     c = Calls.Get(i)
     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 & ", Date=" & DateTime.Date(c.Date))
   Next
When the program "reads" this line Calls = CallLog.GetAll(10) it stops and from logs i see that i must add permission READ_CALL_LOG
If i am not wrong it suppose that adding phone library this action writes the needed permission to manifest
Where am i wrong?
 
Top