Sub Activity_Create(FirstTime As Boolean)
Dim p() As String
p = GetPermissions("anywheresoftware.b4a.designer")
For i = 0 To p.Length - 1
Log(p(i))
Next
End Sub
Sub GetPermissions(Package As String) As String()
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod("getPackageManager")
'get PacakgeInfo
r.Target = r.RunMethod4("getPackageInfo", Array As Object(Package, 0x00001000), _
Array As String("java.lang.String", "java.lang.int"))
Dim permissions() As String
permissions = r.GetField("requestedPermissions")
If permissions = Null Then
Dim permissions(0) As String
End If
Return permissions
End Sub