CloudDB.StoreValue Block not accepting file from Shared folder

Takes me back to my distaste for "shared" directories.

Perhaps change the workflow, store the file in the ASD to cloudDB before moving it to Shared ?

Use Android Studio instead. What else do we got?

nope, been there done that. The problem is probably an issue with the StoreValue block.

You are using the path .../Shared/image-1.png
This path does not exist, does it?
Shouldn't it be .../Pictures/image-1.png ?

Taifun

Yes path does exist Taifun... see post #8. Created it with a file in the ADS.

Also tried with Pictures Folder. Yuk. The path works for Image and Label but not CloudDB. Image is Created from a Canvas saved in ASD and moved to Shared folder. Why CloudDB does not respond. Image and path created by the app?

Here is a test app.
ShareCanvasCloud3.aia (1.8 MB)

  • load the aia.
  • draw something in the pink area
  • press Capture
  • press Store

file should show up in your Shared folder but will not load into CloudDB

In your Screenshots you are using
file:///storage/emulated/0/Shared as directory...
This directory is not accessible...
See also the overview by @Anke here Some basics on Android storage system - #34 by Anke
Try shared storage like /Pictures or /Download or the ASD. ..

Taifun

1 Like

Storing a FILE from the ASD to CloudDB works just fine, testing with companion app, the file....

file:///storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/hsqre1.jpg

returns

/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/AppInventorBinaries/BinFile5014095958271272784.jpg

image

from cloudDB

yes it is accessible.

tried Pictures ... same response.

Thanks @TIMAI2 . Perhaps that happens when you use the Linux Companion. Perhaps the problem is my image is sourced by the Canvas and you are sourcing by an image.png ?

Using Anke's as a guide:

I still cannot populate the CloudDB. Going to read a book.

Correct (at least not on Android 11+).

No, not on Android 11+ as @Taifun already said and you can see in my guide:

EDIT: Yes, there seems to be an issue/bugug with this if you set the DefaultFileScope to Legacy or Shared on Android 11+.

Thanks Anke for your comments. I am testing on an Android 8.1 and an Android 11 and am still lost. :cry:

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. :wink:

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:

grafik

Yes I tested, :astonished: 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.

disabled

Will test on 8.1 Android in the morning.