111642
August 23, 2021, 9:21am
1
Hi
I have added files by uploading them in my application
When I try the program via the connection, the files appear in a folder called Assest in the connection program folder
But when I built the application, the files I added to the application did not appear, although the application size became larger!
How can I access the files that I added to the application? Do I use double slash to access?
111642
August 23, 2021, 9:46am
2
When I was saving a text file for the first time it was asking for access permission
Now don't ask!
I made access permission and it was also denied to copy a text file!
111642
August 23, 2021, 12:12pm
3
Please I need to know why this message?
I've accepted Permission alrady
TIMAI2
August 23, 2021, 12:24pm
4
The main documentation has yet to be updated but you may want to see this:
File Changes for Android API 30 Evan W. Patton, Lead Software Engineer, MIT App Inventor 1. Introduction / Motivation Starting on Aug 1, 2021, all new apps submitted to the Google Play Store will be required to target Android Software Development...
1 Like
Anke
August 23, 2021, 12:25pm
5
On Android 10+ you can no longer copy a file (e.g. from the assets) to the external storage outside of the
because WRITE
permission does no longer exist on Android 10+ if the app is targeting Android 11 (API 30). And this is now the case with AI2 (since the nb187
release, yesterday).
So use the File
component and try to copy the file to the shared storage :
Unfortunately, this only works with Companion and not with the compiled app (APK), as there are still some bugs and permission issues, as I already predicted:
Yes, maybe, but we should have been given the opportunity to test it on the test server until the very end.
I'm pretty sure that there will be issues / bugs with the File component and also with READ / WRITE permissions after the targetSdkVersion = 30 update. I have done a number of tests with Niotron and (also) found some serious issues / bugs there.
1 Like
111642
August 23, 2021, 12:32pm
6
TIMAI2
Thanks
Anke
I use Android 10
I will try same your blocks
111642
August 23, 2021, 1:06pm
7
Anke
This works well
But when I put a subfolder it doesn't work
Like: DCIM/Facebook/...
why?
Anke
August 23, 2021, 1:19pm
8
Here is a test aia: copyToSharedTest.aia (3.5 KB)
Try with Companion, it should work.
But if you change the text of TextBox
from Download
to Documents
if will not work. Check it.
Then build the APK and try again (it will not work, you will get a permission error).
These are the permissions declared in the Manifest:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
So there is no way to request and grant READ
/ WRITE
permissions, which by the way shouldn't be required here either.
1 Like
Anke
August 23, 2021, 1:25pm
9
111642:
This works well
Non-media files (like .txt) can only be copied / saved in these (shared) folders:
But currently /Documents
doesn't work.
(It should work and it works with Niotron.)
So we have to wait for this bug fix as well.
1 Like
111642
August 23, 2021, 1:44pm
10
Anke
thank you very much
Will I be able to copy to a private folder in the future?
How long will I wait for the problem to be fixed?
Because my program will be suspended for the time being
Although my previous project I created two days ago is working fine and I can copy using TaifunFile Extension
with all respect
Anke
August 23, 2021, 1:51pm
11
Yes, with targetSdk = 29 TaifunFile works. With targetSdk = 30 TaifunFile will only work
for devices with Android < 10 and if
WRITE_EXTERNAL_STORAGE
is declared in the Manifest and
WRITE
permission is requested (manually).
1 Like
111642
August 23, 2021, 1:58pm
12
Anke
The users of my project are users
android 10 and less
Because my program is an improvement for some old devices
And the folder I want to copy some files to is Android/data/....etc.
So does this mean that there is absolutely no solution? Even in the future?
If there is a solution, what is it?
111642
August 23, 2021, 5:50pm
14
Hi Taifun
Sorry but I need your help in this post
Hi
I have added files by uploading them in my application
When I try the program via the connection, the files appear in a folder called Assest in the connection program folder
But when I built the application, the files I added to the application did not appear, although the application size became larger!
How can I access the files that I added to the application? Do I use double slash to access?
[blocks]
I use android 10 and my users also 10
Taifun
August 23, 2021, 7:17pm
15
starting with SDK30 you have to use the file component to copy files to the shared storage...
you will not be able to access application specific directories of other apps anymore...
and no, there is no solution... this is the future...
see also Evan’s blog from last year
https://appinventor-mit-edu.ezproxy.canberra.edu.au/blogs/evan/2020/08/08/file-path-updates-android-10
Taifun
Trying to push the limits! Snippets , Tutorials and Extensions from Pura Vida Apps by Taifun.
1 Like
111642
August 23, 2021, 7:25pm
16
How can I use file component?
if I use DB ?Can I?
Taifun
August 23, 2021, 7:51pm
17
see here
Here is a test app (→ Designer: DefaultFileScope = Shared)
with which a text file and an image can be copied from the assets to the shared storage (for devices with Android ≥ 10). This works neither for the text file nor for the image (regardless of whether storage permission was granted beforehand):
"Error 908: The permission WRITE_EXTERNAL_STORAGE has been denied. Please enable ...".
Note: With → Niotron the text file is copied to shared storage (without permission), but you need READ p…
but it seems to be, there are still some bugs around...
111642:
if I use DB ?Can I?
I do not understand... you might want to elaborate...
Taifun
1 Like
111642
August 23, 2021, 8:31pm
18
I mean if I upload a file on DB and using CloudDB to download the file
could I save the file from DB to any Folder in Sdcard? such as system files?
Taifun
August 23, 2021, 8:35pm
19
no you can't
you only can store to the ASD and shared storage
Taifun
1 Like
system
Closed
August 30, 2021, 8:35pm
20
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.