Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private rp As RuntimePermissions
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim sdcardEnabled As Boolean
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
sdcardEnabled = False
End Sub
Sub Activity_Resume
If sdcardEnabled = False Then
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
If Permission = rp.PERMISSION_WRITE_EXTERNAL_STORAGE Then
If Result Then
sdcardEnabled = true
Log("You NOW can write to File.DirRootExternal")
File.WriteString(File.DirRootExternal, "String.txt", _
"This is some string" & CRLF & "and this is another one.")
End If
End If
End Sub