CloudDB.StoreValue Block not accepting file from Shared folder

Yes, you can create that directory. I can add the image to the ASD folder. Unfortunately I have not found a way to recall the image file in the ASD for use in the CloudDB.StoreValue or CloudDB.GetValue Blocks. I unsuccessfully tried using the ASD link using both Companion and an apk. Also moved the file from the ASD to the Shared folder and still cannot get CloudDB.StoreValue to accept that link. I can use that link to fill and Image control and display the image. I can also find the file on the device in the Shared folder.

However, using a real image file or using the link provided by ActivityStarter works fine.:slight_smile:

Where will your original file be located before you upload it to cloudDB?

You understand that a new file is created when you call it back from cloudDB in the ~/files/AppInventorBinaries folder with a different name - something like:BinFile359...852.png ?

Is either in the Gallery (which works with ActivityStarter file
or in the Shared device folder.

file successfully moved from ASD to Shared. :slight_smile:

filelocation

Green checked can access the image-1.png ; the CloudDB1.StoreValue is not able to read it. :cry:

Setting aside my distaste for using "shared" folders ( :wink: ) for a moment:

What error do you get back ?

What filescope are you using ?

If using companion is this the first time the file has been created ?

error is CloudDBerror: No such file or directory destDirectory: storage/emulated/0/Android/data/edumit.apinventor3/files/AppInventorBinaries

filescope is app

get it first time, every time

Is the missing dot between edu and mit just a typo here on the community...?

image

Have you created the AppInventorBinaries directory ?

yes,
yes
asdcreate

image

Neither of these blocks needed for Android 11

right now testing on Android 8.1 where they are supposedly needed. Aware those Blocks are not supposed to be needed on Android 11. Right now neither 8.1 or 11 are working from the Shared directory regardless where I test.

Supposedly you got this working. It is not using the file here with the CloudDB Blocks
shared

although that link works fine with Label and Image components. The CloudDB obviously does not 'recognize' the file, and after all I read, it should . Probably a bug in the component.

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: