non je ne veux pas demander d'autorisation, mais avez vous des exemples avec les blocs ?
Anke
September 18, 2023, 6:25pm
8
agnes_fazio:
examples with the blocks
Show your relevant blocks (for saving / downloading the image).
j'ai fais ça et maintenant je voudrais supprimer en cliquant sur un bouton
Taifun
September 18, 2023, 9:39pm
11
it would have been nice to switch the language to
english before taking a screenshot...
these blocks do not make sense... remove them...
also it looks like you do not download images, you pick images using the image picker, isn't it?
so after picking an image you like to delete it from the device?
Taifun
1 Like
Anke
September 18, 2023, 10:01pm
12
Also you topic ("Comment effacer des images") doesn't make sense.
Before you ask a question / open a new topic
please take care of the following points:
The forum was previously searched for similar topics / issues.
Give a precise (detailed) description of
the issue / bug,
the goal.
Show the (relevant) blocks (images, screenshots of blocks in high quality).
Debug your blocks (connect to Companion and right mouse click: → Do it).
Name the Android / iOS version running on your (test) device.
Do not open multiple threads on the same topic.
If you haven't al…
oui Taifun c'est ce que je souhaite faire , supprimer une image
Taifun
September 19, 2023, 2:45pm
14
It sounds simple, but unfortunately it is not simple to delete an image your app does not own...
From an Android point of view there are an → Internal Storage and an → External Storage .
1. Internal Storage
The Internal Storage can only be accessed with a rooted device.
1.1 The app package is saved in
/data/data/<packageName>/
In order to be able to debug your app, AI2 saves the assets for → Companion on devices with
Android ≥ 10 (API ≥ 29):
/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/assets/
Android < 10 :
/storage/emulated/0/Android/data/edu.mit…
You will have to use SAF
1.Introduction
Description: Basically AI2 wrapper of Storage Access Framework. Using this extension, you can get read and/or write access to a single document or tree document (and all of its children recursively).
Latest Version: 1.3
Released: 2021-09-16T18:30:00Z (UTC)
Last Updated: 2023-11-15T18:30:00Z (UTC)
2.Blocks
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
3.Documentation
Events
ErrorOccurred
Event indicating error/excep…
Taifun
j'ai une image car je la télécharge et ensuite je veux la supprimer
Taifun
September 19, 2023, 3:00pm
16
In your screenshot you are using an image picker... you did NOT download an image, at least not in your screenshot ..
You might want to read again how to ask questions so we do not have to continue guessing...
Before you ask a question / open a new topic
please take care of the following points:
The forum was previously searched for similar topics / issues.
Give a precise (detailed) description of
the issue / bug,
the goal.
Show the (relevant) blocks (images, screenshots of blocks in high quality).
Debug your blocks (connect to Companion and right mouse click: → Do it).
Name the Android / iOS version running on your (test) device.
Do not open multiple threads on the same topic.
If you haven't al…
Taifun
le problème c'est que je ne suis pas experte dans appinventor, je débute. Donc j'essai aussi de comprendre vos réponse c'est pas évident pour moi.
Ma question est : comment je peux faire pour supprimer une image que j'ai téléchargée , je ne veux pas en retélécharger une autre je veux que l'emplacement soit vide
SteveJG
September 19, 2023, 3:19pm
18
Taifun:
You will have to use SAF
to delete from the folder you downloaded the file image to. There is not a simple way to do this.
You probably need to use SAF and this Block:
Anke
September 19, 2023, 3:23pm
19
It seems that you understand "download" differently than we do. Download means that a file/image has been downloaded to your device via a URL address (from the internet).
non pas sur internet , téléchargé dans ma galerie du téléphone
Anke
September 19, 2023, 3:26pm
21
If this image was previously downloaded from another app or you copied it there manually, you will need to use SAF to delete it.
Anke
September 19, 2023, 3:28pm
22
Why? What is the purpose / goal of your app?
c'est de pouvoir renouveler les photos tous les mois et certains mois je ne mettrai pas de photos donc je laisserai le champs vide
avez vous des exemples concernant la méthode SAF
Anke
September 19, 2023, 3:35pm
25
Which folder is it about? Which folder should be empty and why? If you do not want your app to be published in the Play Store, request and grant MANAGE_EXTERNAL_STORAGE
permission to be able to remove images without SAF.
In this guide I show you, how to request and grant → MANAGE_EXTERNAL_STORAGE on devices with Android 11+. Be aware that this permission is usually not granted by Google. However, let’s assume the app is only intended for private use or for special users or for other app stores.
This permission must be declared in the Manifest (since it is not declared the Companion app you can't test this with Companion):
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
Here is a s…