These blocks should work on all Android versions:
saveCanvasCloudDB.aia (8.5 KB)
Android 11+
Note on Android 11+:
If you unistall the app without deleting the image beforehand (or tested with Companion before), you must change the filename of the image, because then the new installed app is another app that cannot access the old file (stored by the previous app version).
This is one of the many pitfalls of this ("idiotic") new Android file system.
Trapped in this pit. Thank you so much for your help. Testing on 11 right now and and things not working as expected. I will try an 8.1 cell in the morning. Thanks.
What is not working as expected?
Not displaying the CloudDB on an Image control.
My screenshots are from a Pixel 2XL (Android 11), tested with the APK & Companion.
Post the blocks ... (or did you try my aia?)
Label1 shows the value
of the CloudDB.GotValue
:
Yes I tested, It is working now (I think) after I disabled Canvas1.Clear. I do not know why. Now I see the Image controls showing the canvas was sent to CloudDB and retrieved. Thanks again.
Will test on 8.1 Android in the morning.
This has nothing to do with Linux....
?? really - I have found it will only save an image using a full path: file:///...../image.png
My blocks are above, for Android 10 & 12 using companion app. This stores returned cloudDB files in the ASD/files/AppInventorBinaries.
Your blocks show that AppInventorBinaries needs to be created in root? is this for android <10 ?
CloudDB, in its current form, does not appear to automatically create the folder AppInventorBinaries
Ok, then post a test aia (like I did, so that we don't beat about the bush again).
cdbImages.aia (2.4 KB)
The folder AppInventorBinaries will need to be created in ~ASD/files/
if it doesn't exist.
File path set for companion testing only, this is to demonstrate storing of a file to cloudDB.
This does not work on Android 11 (outside the ASD), because
/storage/emulated/0/AppInventorBinaries
on Android 11+ programmatically.Btw, which user should come up with the idea to create this directory (beforehand)?
Correct
Explain ? CloudDB should be creating it, but it doesn't do it. I have tagged Jeff about this.
Does my test app (aia) work for you or not?
This
only saves a "string" of the path to the file on the device. It doesn't actually save the file itself to cloudDB.
Thank you for stating the obvious. I was clear about this in my previous post, the blocks are for demonstration purposes when using the companion app to show that cloudDB will store and retrieve a "file", not a path to a file....