F3John
December 8, 2021, 12:50pm
21
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
F3John
December 8, 2021, 2:51pm
22
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?
Anke
December 8, 2021, 3:07pm
23
F3John:
Creating folders
Creating folder, where ?
Show your relevant blocks.
1 Like
F3John
December 8, 2021, 3:15pm
24
/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
Taifun
December 8, 2021, 3:28pm
25
did you try a relative path /Documents/LogFiles
together with the scope Shared ?
Taifun
1 Like
F3John
December 8, 2021, 3:44pm
26
that is working (when the app is opened second time)
any idea why i have to open it twice?
F3John
December 9, 2021, 6:41am
29
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)
Anke
December 9, 2021, 7:41am
30
There are two options:
With the โ File
component :
Without storage permissions (on Android 11+) using the โ FileTools
extension :
I'd prefer the second one.
2 Likes
F3John
December 9, 2021, 7:48am
31
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?
Anke
December 9, 2021, 8:05am
32
DefaultFileScope = Legacy
is essentially STILL responsible for which storage permissions are declared in the Manifest. WRITE_EXTERNAL_STORAGE
is ONLY declared in the Manifest if DefaultFileScope
is set to Legacy
in the Designer. And this even under Android 11+, which of course makes no sense , since this permission is no longer available under Android 11+.
I have pointed this out countless times .
1 Like
Anke
December 9, 2021, 8:21am
33
Here are all permissions declared in the Manifest of your app (after setting DefaultFileScope
to Legacy
):
Permissions
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_FILES"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.webkit.resource.VIDEO_CAPTURE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.webkit.resource.AUDIO_CAPTURE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER"/>
1 Like
F3John
December 9, 2021, 8:41am
34
Thank you @Anke for your Help.
It's now all working as expected.
Maybe one little thing:
Would all this file Stuff work under Android 12? Or will it be a never ending story?
i don't have access to an Android 12 Phone
Anke
December 9, 2021, 8:52am
35
Yes.
I checked it on a Pixel 4XL (Android 12).
Taifun
December 9, 2021, 6:14pm
37
Anke:
DefaultFileScope = Legacy
is essentially STILL responsible for which storage permissions are declared in the Manifest. WRITE_EXTERNAL_STORAGE
is ONLY declared in the Manifest if DefaultFileScope
is set to Legacy
in the Designer. And this even under Android 11+, which of course makes no sense , since this permission is no longer available under Android 11+.
I have pointed this out countless times .
@ewpatton what is your opinion on this?
as @Anke pointed out already several times, it does not make sense as it currently is..
Taifun
1 Like