I am new to B4A but failed a number of times to save text to my mobile folder. My codes are to program a Button to save the text from a EditView. However, I found no fault in my snippets below, but I failed to find the correct resources to edit the Manifest file.
Private Sub btn_SAVE_Click
Dim const FILENAME As String = "MyTextFile.txt"
Dim const FOLDER_NAME As String = "MyFolder"
Dim FolderPath As String
FolderPath = File.DirRootExternal & FOLDER_NAME
Dim textToSave As String
textToSave=txtbox_TEXT01.Text
If File.Exists(FolderPath, FILENAME) = False Then
File.MakeDir(File.DirRootExternal, FOLDER_NAME)
End if
File.WriteString(FolderPath,FILENAME,textToSave)
ToastMessageShow("File saved OK!", True)
End Sub
Private Sub btn_QUIT_Click
B4XPages.GetNativeParent(Me).Finish
End Sub