Code1:
'SavePath = File.DirRootExternal & "/UpJpgToFTP"
Dim outStream As OutputStream
Dim txtWrite As TextWriter
outStream = File.OpenOutput(SavePath,"Test.txt",True)
txtWrite.Initialize2(outStream,"BIG5") '編碼
txtWrite.WriteLine(EditText1.text & Chr(13))
txtWrite.Flush
txtWrite.Close
outStream.Close
Code2:
If PhoneMsg.SdkVersion >= 23 Then
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, PResult As Boolean)
If Permission = rp.PERMISSION_WRITE_EXTERNAL_STORAGE Then
If PResult = False Then
MsgboxAsync("Disagree Storage Rights APP will not be able to be run", "Message")
Activity.Finish
End If
End If
End If
Code2: Confirm permissions
Using Code1 I write the first line of text in Android, Android can read, connect the PC can also read, but, after the second line of text can be read in Android, connected to the PC but can not read, the new text segment, must be re-turned on Andorid, the PC can read, what is going on? How to solve?