For some strange reason FilePicker is at the heart of a problematic Project file corruption:
Has anyone hit this problem before? Is it the fault of this extension alone or did it clash with another extension?
For some strange reason FilePicker is at the heart of a problematic Project file corruption:
Has anyone hit this problem before? Is it the fault of this extension alone or did it clash with another extension?
My guess is, the extension can't be used anymore because of the new file picker component of the new release, see also
https://appinventor.mit.edu/ai2/ReleaseNotes.html
- New FilePicker component (Android only at the moment)
EDIT: the extension needs to be renamed else it can'tbe used anymore...
Also there are still some open questions...
Taifun
Will it work at all Android API levels?
Yes, the extension is tested with Android API 33.
(Thanks)
This extension is now free.
It should also be possible to pick files from the ASD on Android 11+, right?
I've renamed the extension from FilePicker to JewelFilePicker to prevent conflicts with the in-built component.
You can also pick a file from /data/user/0/<packageName>/shared_prefs
in the internal storage, e.g. this TinyDB.xml and read and/or copy it.
Of course, it is not necessary to specify the exact directory beforehand. You can also navigate there from the PrivateDir.
the extension you are using is not the same as in first post of this topic?
Correct. I had raised the question of why it shouldn't be possible to pick files from hidden directories (like ASD on Android 11+ or PrivateDir in the internal storage). And apparently it is possible.
I would like to import an mp3 file to an app I made. But I'm having awful difficulties. Here are my blocks. What stupid mistake have I made?
Looks like you are only setting a filename to the Source, when you perhaps need a full or absolute path
Also, unless your mp3 is only a few seconds long, you need to use a Player component instead of a Sound component.
You should have mentioned that you changed your extension because the picked files are now always copied to a subfolder in the PrivateDir and the absolute path is returned in the .FilePicked event, e.g.:
/data/user/0/edu.mit.appinventor.aicompanion3/files/JewelFilePicker/jarsigner.txt
However, this cannot be processed by most components (including the File component) because most of them use a relative path.
In addition, if a text file has been selected that is to be edited afterwards, this file can no longer be accessed via the FilePicker because this directory is just as invisible as the ASD on Android 11+. The edited test file would therefore have to be copied (moved) back to one of the shared folders in order to continue to have access to this file via a FilePicker.
Incidentally, the other components (and extensions) that do not use a relative path only have access to the PrivateDir if a full path is used.
Yes, the sound is only a few seconds long. When I use filePath the result comes back as a numeral not as text.
Will try again using path to get it to play. Thanks for your help.
filepaths
is probably a list, so you cannot pass it as a file. You will need to select just one of your multiple select files, or iterate over the list, selecting one at a time.
A search on the community turned up this: