Files and folders

My test app only creates the folders (but does not copy any file).
So again: Did you test my aia (FileTest.aia)?
I tested it with Android 9, 11, 12 (Companion & APK). It works on all devices.

Sorry Anke,
i misunderstood your question.

Your Example is working (tested as APP)

The Extension from @vknow360 is also working

I will try to get your example working in my App.If it's not working i have the extension as backup

FilesList does not work anymore.
known Bug?

Companion or APK?
If the app is uninstalled and reinstalled you can no longer list these non-media files, because they are created by another app (the uninstalled app).

(They must be created / saved again with different file names. Otherwise you have to use SAF.)

Try this aia (coming from Anke testfile), you can list only files saved from app.
DocFolderCreaList.aia (2.3 KB)

1 Like

Have a look to How to request and grant MANAGE_EXTERNAL_STORAGE permission
Be aware that this permission is usually not granted by Google. However, let’s assume the app is only intended for private use or for special users or for other app stores .

1 Like

ah yeah,
i copied the files with the desktop pc to the LogFiles folder
so if the files are copied with the App to this folder it will work?

But with Android 10 the files are also not listed?!

Yes, but you cannot overwrite / replace existing files, that were not created by the app. So you have to change the file names.

ok, i will try it

i got it working:

File (received via Bluetooth) is written to ASD -> work on Android10
If File is ok it's copied to Documents/Logfiles -> work on Android 10

So now i want to open this file in a CustomWebview (with file Access and Js)
for that i copy the file from Documents/Logfiles to ASD/files/Webview (where the index.html is saved)

but when opening the webview the App crash and close -> Android 10
this was working before all the file changes

edit: the file is not copied to webview folder (is ASD)

test's on Android 11 are coming later -> i'am have not access all the time

i think i got it running.

But i noticed a little Problem:

Creating folders with Android 10 requires Permission for Write external Storage (same for copy?)

But with Android 11 i get an Error message that this permission is not allowed.

is there a nice work around?

Creating folder, where?
Show your relevant blocks.

1 Like

/storage/emulated/0/Documents/LogFiles
i also cant copy to this location

i have to use the permission:

Everything for Android 10

edit:
for test i removed the App and Documents/LogFiles

with permission the folders are created
without permission the folders are not created

did you try a relative path /Documents/LogFiles together with the scope Shared?
Taifun

1 Like

that is working (when the app is opened second time)

any idea why i have to open it twice?

Try this:

grafik

That is working👍

i think i'am going crazy

now everything is fine on Android 10
but on Android 11 nothing works, i just get following error:

No folder is created!
Ankes examples are working with Android 11. And i cant find a difference.

@Anke what is the "call exist"?

Here is my aia, maybe someone find an issue
BlControl(1).aia (967.9 KB)

There are two options:

  1. With the → File component:

  2. Without storage permissions (on Android 11+) using the → FileTools extension:

I'd prefer the second one.

2 Likes

thank you @Anke. i will try it.

i found the difference between your filetest and my app

default File scope in Screen settings
you had "legacy"
i had "App"

i thought legacy mode wont work in the future?