Sub Process_Globals
Public ExtStorage As Boolean = False
Public ReadPhone As Boolean = False
End Sub
Sub Activity_Create(FirstTime As Boolean)
ExtStorage = rp.Check(rp.PERMISSION_READ_EXTERNAL_STORAGE)
ReadPhone = rp.Check(rp.PERMISSION_READ_PHONE_STATE)
If (ExtStorage And ReadPhone) Then
StartActivity(GUI)
Else
Activity.LoadLayout("Setup")
Dim Msg As String = _
"Due to new security requirements from Google, you will be required to allow certain permissions. " _
& "It is highly recommended that you accept these requests. Once accepted, you will not be asked again." & CRLF & CRLF
If Not(ExtStorage) Then Msg = Msg & _
"The photos, media, and files request is to allow downloading files to the SD card." & CRLF & CRLF
If Not(ReadPhone) Then Msg = Msg & _
"The make and manage phone calls request is to allow pausing the show when the phone rings. No outgoing " _
& "calls or other phone access will be required." & CRLF & CRLF
Msg = Msg & _
"Press the OK button to answer the prompts and start the app"
txtMessage.Text = Msg
End If
End Sub
Sub btnOK_Click
GetPermissions
End Sub
Sub GetPermissions
ExtStorage = rp.Check(rp.PERMISSION_READ_EXTERNAL_STORAGE)
If Not(ExtStorage) Then
rp.CheckAndRequest(rp.PERMISSION_READ_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
ExtStorage = Result
End If
ReadPhone = rp.Check(rp.PERMISSION_READ_PHONE_STATE)
If Not(ReadPhone) Then
rp.CheckAndRequest(rp.PERMISSION_READ_PHONE_STATE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
ReadPhone = Result
End If
StartActivity(GUI)
End Sub