Create My App Album

Can you please give a small explanation about Arbitrary Folder? I didn't know anything about Arbitrary Folder. And also I want to make a new folder for my app, I didn't want to save my canvas images in /Pictures, /DCIM, I want to save them in the app's folder like Instagram has Instagram Folder.

starting from Android 10 storing files got complicated, this Some basics on Android storage system should give you a good overview...
which means, you can't store files anywhere you like anymore... you have to store in shared storage or in ASD - application specific directory...
you also can store in subdirectories of shared storage, for example /Pictures/myCanvasImages

Instagram stores on /Android/media/com.instagram.android... I think, you also could store in /Android/media/YOUR PACKAGE NAME... but probably you need the SAF extension for this, which makes it again more complicated... just give it a try and let us know, what you find out...

Taifun

I have a similar problem. I have a variable (product list - about 30 - 50 names). This can be changed and saved in the TinyDB as list. So I want to create a list with images from Album and save it in TinyDB (like another variable also having 30 - 50 items). I want to create these functions:

  1. take a picture/photo from Album (e.g. using ImagePicker)
  2. save picture on app memory / app folder on specific index in the list

Sth like this (for all products):
TinyDB [tag "name"] > tag "description" > tag "photo"
1: ProductA > description > photoA.jpg
2: ProductB > description > photoB.jpg
3: ProductC > description > photoC.jpg
...
50: ProductZZ > description > photoZZ.jpg ...

How can I copy an image from Album to the App (but about 50 each)?

Please tell me how can I make ASD or Subdirectories of Shared Storage. And also I am confused about ASD, Shared Folders, Subdirectories of Shared Folders.

I created this, but it is only directory. I don't know how can I copy image from Album to this directory :thinking:
obraz

It's created automatically. So no need to create it.

For example:
/storage/emulated/0/Pictures/Kids

As I said, read this: Create My App Album - #4 by Anke
and see also here:

You cannot create this dir on Android 11+. You must use the ASD or one of the Shared folders.
So read my posts and the appropriate links I referenced.

This is NOT a solution (at least not on Android 11+):

@Sarthak So remove the Solution marker. Or I'll do it.

I didn't mark it as Solution. Please remove the Solution Marker. And also I read your post but now also I didn't understand what is ASD and Shared Folders. Can you please give a life example to explain these topics?

1 Like

ASD = application specific directory = only your app does have access to the files stored there
shared storage = other apps also do have access to the files stored there (therefore it is called shared storage).. hope that helps...

so according what you said earlier

the easiest solution for you if you want other apps be able to access the images is to store them in /Pictures/yourFolder or /DCIM/yourFolder

Taifun

2 Likes

Ok! Now I am able to understand this. Thanks.
So can you please tell me that how can I make a shared folder for my app.
Thanks For Your Time

All of this is described in detail in my guides.

To clarify this again:

  1. Non-media files not created by the app itself cannot be accessed by other apps
    → without using SAF or
    → request and grant MANAGE_EXTERNAL_STORAGE permission.

  2. But media files that are not created by the app itself can be accessed from any location (outside of the ASD or PrivateDir) with READ_EXTERNAL_STORAGE permission.

1 Like

As I already said:

1 Like


Now this error is coming.

Show your blocks. If this image (...Images_7.jpg) was already created by another app, you cannot overwrite it (on Android 11+). You must delete it beforehand or better use another filename (e.g.: ...Images_7a.jpg).

Note: Companion and the APK are also different apps. So if you created this file with Companion before, you cannot overwrite it with the compiled app (APK).

Below are my blocks:


when exactly does this error occur?

some observations:

  • like this the Canvas.SaveAs method stores the file in the ASD... is this what you want? the path to the shared storge is missing there...

  • you are using the synchronous Move method, which means, the Moved event never will fire... that event only fires after using the MoveAsync method... see also the documentation...

. the ShareFile method might need a full apth (starting with file:///storage/emulated/0/Pictures/... ) or a relative path (starting with /Pictures/...)

Taifun

Try to replace the underscore "_" with a minus "-" (here: ...KidsDibujoImages-...)
and use the move async block (as @Taifun mentioned) to trigger the TaifunFile.Moved event.

The TaifunSharing block looks fine (using an absolute path), but you can also use the Sharing component.

Where can I find "TaifunFile.Move"?

You can find the file extension here App Inventor Extensions: File | Pura Vida Apps

Taifun

1 Like