@Taifun thank you. This is the link I see in a lot of messages, and before I wrote here a little bit I looked at it, but it doesn't seem to me that there is among that list of titles, the one that allows me to reach my goals:
Have a button that makes me take a photo
that shares it with gmail
show me a pre-filled gmail message with TO, subject, and attached image
let me just click to send the email, using the gmail button
A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .
You are expecting to get the afterActivity AFTER you start the Activity, but you try to build the email at the same time! Look at my blocks again. You need to get your process workflow in the correct order:
Take Photo
then
*Copy the photo taken from your ASD to shared storage (Downloads or Pictures for example)
then
Get Photo file path from Shared Storage (you could use Activity starter pick/get content here) and set to a label/variable
then
use the extension blocks to build the email, using the above label.text / variable value for the file path
The activity starter blocks in @TIMAI2 's example pick an image from shared storage... however your image is stored in ASD amd the activity starter can't pick from there. .
Also as far as I can see @TIMAI2 's extension is not able to send attachments from ASD... @TIMAI2 is this correct?
If you want to use @TIMAI2 's extension then you should copy your image to shared storage and attach it from there
The file in question for the attachment will need to be from Shared Storage otherwise GMail will not be able to find it (and as Taifun says, could not be picked from the ASD using the ActivityStarter in any case)
I have edited my post above top reflect this for others passing here
And then I'm kind of glad to see that it's not such a simple thing.
However, I need to find a way not to have the photo selected, but to send the one taken directly.
But don't waste any more of your time.
your only posibility is to use the activity starter solution (or @TIMAI2 's extension, which is based on the activity starter) to open the client mail app to send the email from there
To avoid picking the file after the image has been copied to shared storage use a file extension to convert the filename to a content uri... my file extension offers the GetUri method for that
The question is, why do you have that requirement?
You could have an app specific Gmail account and all users of your app send emails using that account without even knowing user and password of that account. .
I am joking. Mainly because I want the user to manage it with the best existing email client (and in any case with the one he/she prefers), not with a limited client created by me.
I want the message to not be sent automatically after the shot, but to optionally add anything else after.
And I thought that with MIT you could send a photo you just took to an email client in a more native way, also being able to set pre-filled fields.