A small App to generate a txt File with 4 values for each line
Good evening everyone,
My name is Peter, and I’m completely new here, both to the forum and to creating APK files.
I’ve tried to create a small file, and it worked quite well on the first attempt. It’s designed to simply take input from 4 fields and write it to a file called “Inventur.txt” when the “Save” button is pressed. Whenever new input is entered, it should be written as a new line in the .txt file. The file should be stored under Documents/Inventurdaten/Inventur.txt.
The app installs fine. Input works, and the fields are cleared upon saving. However, no file is being created. I’m getting Error 908 related to permissions and Error 2103. I’ve tried incorporating AskForPermission with READ and WRITE, but that didn’t work either. What am I doing wrong here? I’ve already read a post about modifying the manifest, but I don’t know how or where to do that.
This is intended to run on Android 10, and I’d like to test it on my phone with Android 14.
I also tried to use a button for “create Dir” and integrate a MakeDir function within it, but that isn’t working properly either. I also searched in vain for a simple “Do” command but couldn’t find one.
Attached are images of the code blocks and permissions for File1.
Welcome to the Community! To write documents/files to Shared scope, you actually don’t need to ask for READ/WRITE permissions from the user. You can read more about it here:
You only can append data to a non media file (i.e. a text file) like this, if your app owns the file. Which means you can’t replace or copy the text file to that destination from outside of your app.