CloudDB.StoreValue Block not accepting file from Shared folder

It also doesn't work on Android < 10 with Companion.

If you change the path (on Android 9):

you get this:

And this folder was empty before.

Again, I never said it did. My blocks are not about file storage locations on various android versions.

@SteveJG was initially working on an Android 11 device, hence my blocks for 10 & 12 to show how to store a file in cloudDB (for the fifth time...)

We're looking for a general solution here, as @SteveJG mentioned often enough (also for Android 8.1; did you read that?). And I showed how it's done.

Your approach for Companion only on Android 11+ doesn't get any further in this regard.

This is seems to be true @Anke unfortunately. I just woke up awhile ago and did some testing.

I added an event handler to query the CloudDB. Although Tags are created, the db does not store the image. It does create an image file. That file does not appear to be saving to the db.

Sorry.

@TIMAI2 Sorry. The example you posted is not practical and is not a solution.

Have either of you tested my example in post #13 ? It doesn't work. It shows my methodology provides a file that works stores code that can be accessed by a Label or a Image but that does not populate a CloudDB . :cry:

I believe Anke is right. There is a problem regarding what can be fed into to CloudDB. A file from Media can post, a file stored in Shared (or Pictures) cannot based on what I can see.

        shows the images, but they are not from the CloudDB Anke. Querying the database using a Tag does not return the image.

Thanks for everyone's suggestions. :slight_smile: It is still impossible to post an image file from the Canvas to CloudDB.

And I never claimed this, btw.

Try this aia project

canvas2cdb.aia (3.2 KB)

Tested on companion and compiled Android 7, Android 8.1 and Android 12

Just touch the canvas a few times to make some circles, then save the canvas. Then "store the image" to cloudDB, then retrieve the image and display it, along with the file path to the new, retrieved image.

Android 7 and 8.1 will require you to set the Storage permission in App Settings, I couldn't be arsed to sort that bit out

image

from Android 7

Doesn't work (outside the ASD) using

grafik

I really do not know how to answer that :wink:

Seems to do what is expected using Companion Tim :slight_smile: I tested on both Android 8.1 and 11 and did not have to set Storage permission in App Settings.

Thank you for posting the code. I'll play with this later this afternoon and build the apks.

You will with the compiled app :slight_smile:

Does this work for you?
So saving the image directly to a non-ASD folder:

grafik

grafik

Tim's code works on apk in Android 8.1 but as he mentioned requires manual Storage permission in Settings. On Android 11 the apk works without asking for permissions. :slight_smile:

The example 'works' to share the image between devices. :astonished:

I tested my blocks on Android 9 with Companion:

It does not work, as I said.
canvas2cdb_1.aia (3.3 KB)

In the subject of this thread you are talking about Shared folder... this is misleading, because the folder /Shared not realy is shared storage in the sense, Android is understanding it... it is only an arbitrary folder in the root directory of the emulated sdcard, which is called /Shared...
You might want to adjust the subject accordingly to avoid misunderstandings...

Taifun

The thread started out discussing the Shared folder that exists in the device operating system in an attempt to solve the app design. I prefer to allow developers to read all the posts to understand what I was doing (try to do). Perhaps I should have indicated not accepting file from the device folder called Shared folder . The file was moved from the Ads to 'Shared' and also to Pictures. Both locations are accessible to an Image or Label component but CloudDB can not use it at a source o valueToStore.

Developers can read your post to 'avoid misunderstandings" I believe. Thank you for your 'technical' point. :slight_smile:

Tim's potential solution how to get a Canvas image into the CloudDB does not use a folder called Shared of course.

  1. What does all this have to do with CloudDB?
  2. It doesn't work outside of ASD on any Android version (but it should).
  1. It has everything to do with CloudDB (sharing between devices)
  2. It has nothing to do with not working outside of the ASD - which you seem to be obsessed with....
  1. Then I'm curious about your explanation.
  2. Of course it does, it should and had to work there too.

Yes, my fault, it has nothing to do with it, but it doesn't work with DefaultFileScope = Legacy or Shared (at least not on Android 11+). You can ONLY choose DefaultFileScope = App or Private.

But I'm still curious how to share these images from CloudDB across apps. :thinking: :woman_shrugging:

Each device has the same app
Each user can call back the taglist (which are the tags for the images)
Then the user, selecting from the taglist, can then download the image from cloudDB to their device

Each user can generate images and upload them with a tag to the cloudDB, an updated taglist would show new images...

Alternatively, the developer can store a set of images to the cloudDB (with, say, an admin app), and these images can be downloaded to the user app for use in the app.

It would make good sense to resize images before uploading to cloudDB in order to minimise size and maximise speed.