|
Iniciado por ClaudeHullq, mar., 09 2021 12:47 PM - 3 respostas |
| |
| | | |
|
| |
Membro registado 10 mensagems |
|
Publicado em março, 09 2021 - 12:47 PM |
Simple Android app. Two text files added to the "Integrating files" page in Android application generation tool. My.txt and Marks.txt are in the My Mobile Projects...Exe subfolder, both given Write privilege's. The My.Txt file sucessfully updates content with the fSaveText function.
s is string s = "New content" IF fSaveText("My.txt",s) = False THEN Info(ErrorInfo) END s = fLoadText("My.txt") Info(s) but changing "My.txt" to "Marks.txt" does not update when run on the Android device. Both files have the same attributes on the PC. And both work fine in the simulator on the PC.
I've tried using fOpen(), fWrite(), then fClose(): same story. Tried fSaveBuffer. Same. Tried changing file name, extension (and updating the "Integrating files" settings). Nothing is working with the second file. Tried to check fAttribute() but it just returns a blank empty string. Rebooted, updated WINDEV Mobile 26 (running 260075p) hoped that would fix it, but didn't. What's going on here? |
| |
| |
| | | |
|
| | |
| |
Membro registado 10 mensagems |
|
Publicado em março, 09 2021 - 2:20 PM |
Update: Actually both files are not updating. The code sample I provided was for the Marks.txt file. My.txt which I thought was working, was saving to a global string variable. If I close the app and restart. The file in fact was not updated. What do I have to do to get write privileges? The Write check box is checked in "Integrating files." |
| |
| |
| | | |
|
| | |
| |
Membro registado 10 mensagems |
|
Publicado em março, 09 2021 - 4:41 PM |
Fixed: Seems that fLoadText("file.txt") correctly opens and reads files in the /files directory without specifying a path fSaveText() however, at least for me, requires a specified path. In my case: "/data/data/com.site.appname.go/files/" (.go for testing) Also discovered that the Write check boxes only affect auto-extraction during installation of the app. |
| |
| |
| | | |
|
| | |
| |
Membro registado 909 mensagems |
|
Publicado em março, 10 2021 - 7:51 PM |
Hi, you should not use specific paths as that may change with different Android versions or different manufacturers' models. Use instead functions like fDatadir to let WM assign the correct path.
Rubén |
| |
| |
| | | |
|
| | | | |
| | |
|