Another "dummies" question from a B4A newbie which probably has a simple answer.
In a B4A app I am trying to write a file to internal memory but I keep getting errors. I want to use internal memory as I might be switching SD cards so want the data there all the time. 2 Samples of my code are:-
Code example 1:-
Dim list1 As List
Dim directory1, testfile As String
directory1 = File.DirRootExternal
testfile1 = "testfile1.txt"
File.WriteList(directory1, testfile1, list1)
Code example 2:-
Dim list1 As List
Dim directory1, testfile As String
directory1 = "/"
testfile1 = "testfile1.txt"
File.WriteList(directory1, testfile1, list1)
The first example writes perfectly OK to external memory (as I can detect it using File.Exists) but the 2nd one for the internal memory location generates errors. I have tried different paths but they all cause errors unless I use File.DirInternal then it's OK (but I understand that I cannot then access the saved file outside the app).
The code above is based on the "Android Tutorial - Text Files" dated Nov 28 2010 so I'm not sure if those code examples are still valid.
Many thanks
Brian
In a B4A app I am trying to write a file to internal memory but I keep getting errors. I want to use internal memory as I might be switching SD cards so want the data there all the time. 2 Samples of my code are:-
Code example 1:-
Dim list1 As List
Dim directory1, testfile As String
directory1 = File.DirRootExternal
testfile1 = "testfile1.txt"
File.WriteList(directory1, testfile1, list1)
Code example 2:-
Dim list1 As List
Dim directory1, testfile As String
directory1 = "/"
testfile1 = "testfile1.txt"
File.WriteList(directory1, testfile1, list1)
The first example writes perfectly OK to external memory (as I can detect it using File.Exists) but the 2nd one for the internal memory location generates errors. I have tried different paths but they all cause errors unless I use File.DirInternal then it's OK (but I understand that I cannot then access the saved file outside the app).
The code above is based on the "Android Tutorial - Text Files" dated Nov 28 2010 so I'm not sure if those code examples are still valid.
Many thanks
Brian