Android 11 no puedo guardar PDF en carpetas

Hola, necesito saber que poner en la pantalla 1 para poder generar archivos pdf que en versiones anteriores de android podia con WRITE_EXTERNAL_STORAGE pero con android 11 me dice que no.

just store the pdf file in the ASD - application specific directory, for details please search the community

after App Inventor targets SDK30 it looks like we will not be able to store files to a directory on the internal (emulated) sdcard anymore except of the ASD
the MIT App Inventor team still did not decide if we will be able to store something to the shared storage then

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

It doesn't work!! :sweat:
help pleasse

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

1 Like

see again what I said earlier

which means, probably we will need an extension to access the shared storage

Taifun

1 Like

what exactly does not work? Can you elaborate?

@Juan_Antonio might want to help you concerning the correct path to use for the ASD in that extension
usually I would use an extension, which is able to provide the correct path both for the companion app and as well after building the project...

Taifun

Ok English is not my language but I will try to explain myself.

When I use this application on an android 9, I push the button1 and it generates a pdf file in the folder that I created with the extension Filetools (PDFapp) see attached image 1. I'm using the Filetools and KIO4_PdfS1 extension.

Now, when I use a tablet with android 11, it creates the folder but not the pdf file.

I know that the problem is from May 5 and I have to delete the WRITE EXTERNAL STORAGE, but I don't know how to replace it or get the pdf file to be saved on my tablet with android 11.

On my tablet with android 11 it does not generate the folder in /storage/emulated/0/android/data/appinventor.ai_augustomartinfPDF/files. Why will it be?

Regards!!!!

@AUGUSTO_MARTIN_FERNA
@mypat

On this page you have the latest version:
http://kio4.com/appinventor/284C_extension_crear_pdf.htm

With Android versions> = 10, use the blocks ending in 10, for example "Create10"

The files will be saved in the ASD.

Juan Antonio gracias por la respuesta, de todas formas no funciona. Entro a la carpeta donde debería estar (carpeta ASD) y no está el archivo.

No, this will become relevant when AI2 targets API 30 (Android 11), which will be the case from August 2021.

1 Like

So why doesn't it work on my tablet with android 11 and if it works on another tablet with android 10_?

How can I see which version of android my app is targeting to?

Obviously the problem is in the extension since I can create folders and take screenshoots without any problem with other extensions.

@AUGUSTO_MARTIN_FERNA

Try this example (with the finish block on another button):

pdfA11_C.aia (12.1 KB)

Antonio, mira el video. No guarda los archivos en donde deberĂ­a. Que crees que sea?

@Juan_Antonio

The part below the red line is the pdf file.

La parte naranja de abajo es el archivo pdf.
Añade una imagen al VerticalArrangement

@Juan_Antonio, eso lo se. Pero el archivo .pdf no está en ninguna carpeta en el almacenamiento interno de la tablet.

This is rather a problem with your file manager not ms accessing the ASD directories.
The file is there, but you can't see it. See if your manager can have higher permissions to read files, or install another manager. Alternatively, connect the phone to the computer and check these folders on the computer.

@Juan_Antonio Observa el video que cargué. El archivo .pdf o la carpeta de la aplicación no está Android/data/...

You do not understand. In android 11, asd folders are hidden. You won't normally see them. Follow the instructions from the previous post.