Still Error 908 / 2103 with permissions

What is the name of your app?

Inventory

Describe your app:

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.

Have a nive evening everyone
Best regards
Peter

Screenshots:


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:

To fix the saving issue on your app try this:

:backhand_index_pointing_up:t3: Disable the unnecessary permissions

:backhand_index_pointing_up:t3: Start the file name with a “/”.

I have tested this to be working on my phone running Android 15. Let me know if it works for you.

Happy koding!

Read this

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.

However if you want to do that, you need SAF

Taifun

Hy together,
sorry for the long wait time until my response.

At my scanner with Android 10 it seems that i need the checked boxes with permission. Otherwise it wont save in the txt file.

At my Smartphone with Android 14, it rly makes no sense. But i just need my Phone for some testing (better handle than the scanner :D)

Thanks for the hint with the file name starting with a “/”.

The program now works fine. Unfortunately its no longer valid to make a automatic attachement when open gmail. But thats no problem.

I have tested the programm today at the scanner with the moidifications and its wonderful =)

Thank you Taifun and Kanishka_Developer for your help.

Best regards

Peter