rfresh Well-Known Member Licensed User Longtime User Jan 9, 2019 #1 I need to save some data in a file (.txt would be fine) and then have my app open the file and read in that data. Is there a tutorial on how to read and write .txt files? Is this best done using a simple .txt file or is there another preferred way to save data? Thank you...
I need to save some data in a file (.txt would be fine) and then have my app open the file and read in that data. Is there a tutorial on how to read and write .txt files? Is this best done using a simple .txt file or is there another preferred way to save data? Thank you...
Erel B4X founder Staff member Licensed User Longtime User Jan 9, 2019 #2 I'm sure that it is covered in the programming guide and in the video tutorials: https://www.b4x.com/b4i/documentation.html Look for File.WriteText. Upvote 0
I'm sure that it is covered in the programming guide and in the video tutorials: https://www.b4x.com/b4i/documentation.html Look for File.WriteText.
rfresh Well-Known Member Licensed User Longtime User Jan 11, 2019 #4 What library do I need? I selected the iRandomAccessFile but I still got the errors below. These lines give an error: unknown member: File.DirRootExternal or ExternalWritable Code: Copy File.WriteString(File.DirRootExternal, "String.txt", _ If File.ExternalWritable = False Then There is no File.WriteText in the example code in this URL: https://www.b4x.com/android/forum/threads/text-files.6690/ It seems to be for B4A and not B4i (at least there is no B4i tag in the URL page). Upvote 0
What library do I need? I selected the iRandomAccessFile but I still got the errors below. These lines give an error: unknown member: File.DirRootExternal or ExternalWritable Code: Copy File.WriteString(File.DirRootExternal, "String.txt", _ If File.ExternalWritable = False Then There is no File.WriteText in the example code in this URL: https://www.b4x.com/android/forum/threads/text-files.6690/ It seems to be for B4A and not B4i (at least there is no B4i tag in the URL page).
aaronk Well-Known Member Licensed User Longtime User Jan 11, 2019 #5 https://www.b4x.com/android/forum/threads/files-and-folders.46137/#content Upvote 0
rfresh Well-Known Member Licensed User Longtime User Jan 11, 2019 #6 I created a file with the following code but I don't see it on my iPad: Code: Copy If File.Exists(File.DirDocuments, "12.txt") = False Then File.WriteString(File.DirDocuments, "12.txt", "test") End If Upvote 0
I created a file with the following code but I don't see it on my iPad: Code: Copy If File.Exists(File.DirDocuments, "12.txt") = False Then File.WriteString(File.DirDocuments, "12.txt", "test") End If
aaronk Well-Known Member Licensed User Longtime User Jan 11, 2019 #7 Did you add the following code and watch the video from the link in my last post ? Code: Copy #PlistExtra: <key>UIFileSharingEnabled</key><true/> Upvote 0
Did you add the following code and watch the video from the link in my last post ? Code: Copy #PlistExtra: <key>UIFileSharingEnabled</key><true/>
rfresh Well-Known Member Licensed User Longtime User Jan 12, 2019 #8 Yes, I added that line of code. And yes, I watched your video but didn't understand what it was doing. I am trying to write a file to my local iPad and not share it on iTunes. In my iPad, my file manager shows me my Documents folder but I don't see the file in there. Attachments IMG_0088.PNG 74.9 KB · Views: 417 Upvote 0
Yes, I added that line of code. And yes, I watched your video but didn't understand what it was doing. I am trying to write a file to my local iPad and not share it on iTunes. In my iPad, my file manager shows me my Documents folder but I don't see the file in there.
Erel B4X founder Staff member Licensed User Longtime User Jan 13, 2019 #9 You need to do it with iTunes. Upvote 0
rfresh Well-Known Member Licensed User Longtime User Jan 13, 2019 #10 >You need to do it with iTunes. What does that mean Erel? That my file will be on iTunes and not on my iPad? Upvote 0
>You need to do it with iTunes. What does that mean Erel? That my file will be on iTunes and not on my iPad?
aaronk Well-Known Member Licensed User Longtime User Jan 14, 2019 #11 rfresh said: You need to do it with iTunes. Click to expand... Yes. Apps can't view other apps files when using iOS. rfresh said: That my file will be on iTunes and not on my iPad? Click to expand... The file will be on your iOS device but you can also view it in the iTunes software when you plug the device into your computer. Check out the video: Upvote 0
rfresh said: You need to do it with iTunes. Click to expand... Yes. Apps can't view other apps files when using iOS. rfresh said: That my file will be on iTunes and not on my iPad? Click to expand... The file will be on your iOS device but you can also view it in the iTunes software when you plug the device into your computer. Check out the video: