Code doesn't work... trying to read a text file

The code doesn’t work. I’ve tried everything.
Read From and Got Text do not work. They do not return text or error message.
My android is 11
Does not read either the card or the internal storage

Can someone help me ?


I have never used package utilities but I guess you need to write your app package name instead of version name

1 Like

You can’t ask for permission and at the same time read a file before permission has been granted

Therefore reading should be in another event, for example a button click event

Another thing is, for reading non media files, which not have been created by your own app, you need SAF… and you only can read from shared storage, i e. /Download or /Documents, see also Some basics on Android storage system

Taifun

2 Likes

I made the changes you asked, but it still doesn’t read the /Music/FUN.TXT file

It does not reach the GOT TEXT block.

What could be preventing the reading of the .TXT file because it doesn’t return anything and doesn’t even give an error message.

1 Like

Should I turn on Legacy Mode?

How to turn this on?

Which blocks?

(excuse for my bad eng) :slight_smile:

Unfortunately not…
You forgot

and
.

Where are you using SAF?
And remember, you can’t read text files from /Music, you only can read from /Download or /Documents

Taifun

1 Like

ScreenKodular

I added the SAF extension and got the error:

[Permission denied]
[Open Failed]

I think I entered the string path [file:///storage/emulated/0/Downloads/FUN.TXT] in the wrong format or do I have to ask for permissions?

  • Fixed error: Download > Downloads

:moyai:

᲼᲼᲼
᲼᲼᲼
᲼᲼᲼᲼᲼᲼

Read the SAF thread to find an example there
Taifun

I think it is incalculable nonsense that Google can make Android programming worse. They made everything harder and more complicated (perhaps due to the lack of another concurrent environment) so complicated that the forum staff cannot explain or help users with problems. Every day I see programmers abandoning programming languages ​​like Kodular, looking for solutions to their mistakes and difficulties.

I myself tried here and in several help forums and I didn’t get help to solve my problem of accessing a simple TXT file, which is blocked and without read access, I tried everything but I couldn’t, in fact, the people who helped me here you’re more lost than I am.

I’ll ditch Kodular and try Kotlin or JavaScript…

Thank you for listening!

I am very sad and disappointed.

There are no solutions there, but users looking for solutions and finding more problems.

It is your decisión to not read the thread to find the solution…
Sorry, I will not do the work for you…

Good luck

Taifun

image

I looked for ReadFromFile and just found this screen totally useless. The posted extension does not have clear examples such as:

  1. How to handle error messages like Permission denied and Open Failed.
  2. Examples of paths, and which folders to use to access these paths.
  3. Which folders are shared folders, private folders or root folders and which ones can I access and which files to expect inside.
  4. Should I use Permissions or not to access certain folders.

etc, etc, etc…

Otherwise it’s a useless extension…

Thank you very much for your feedback… I will forward it to the author of this extension @vknow360

Taifun

1 Like

I am sorry for the delay as well as for not providing required documentation.
Please check this aia:
SAF_RW.aia (33.0 KB)

Original aia credits to Chris Ward.

You can find a few more examples from @bodymindpower in that thread.
Also, please have a look at this guide from her

(Already posted by @Taifun )
I am thankful to Taifun also.

1 Like